Richard Morgan

There are many ways to handle player management. Here is what I would consider the preferred way…

This is an example of a clean player management setup:

The idea is that the Input Actions Script handles the inputs, the Player Management Script handles the processes triggered by the inputs…

--

--

Let’s create an action map for our dog. Here are the inputs:
Bark Action (Space key)
Walk Action (WASD keys)
Run Action (Left Shift held down for more than 1 second)
Die Action (D + F keys at the same time)

The Bark Action is a button:

And it’s bound…

--

--

Here’s a simple example that shows how Action can replace delegate/event statements and accomplish the exact same thing.

Here we have a UI script that needs to be updated whenever the Damage method of the Player script is executed.

We declare our Action in the Player and set it to…

--

--

Here’s a quick way to respawn in Unity using delegates and events…

In this example, we’re going to use the SpaceBar to initiate the respawn event:

Inside our Main script (attached to the MainCamera), we’ll create the Teleport delegate and give it a Vector 3 value that will be the…

--

--

Richard Morgan

Richard Morgan

Unity and Flutter developer interested in creating mixed-reality applications.