Input Manager Simplified

Events, actions, enable, disable, lots of stuff going on here. How can we simplify this a little and get to basics. Let’s start by creating a capsule and do a simple movement system. I’m going to create a player capsule and add simple controls the old way.

This allows me to move the player forward when holding down W. I am also going to allow both systems for testing purposes. This is in settings/player

Next, I’m going to add a player input component to my capsule.

Afterwards, I’m going to create my own input action system. I’ll start with player movement and then add an attack. Be sure to save the input.

Drop in the player gameobject into the movement object and choose the direction function.

We can connect with those through events now. In the script, get your input library.

Now let’s create the functions that your event system will access. We will take the basic structure of the prior movement. We create parameter to pass through (vector 2) to a horizontal and vertical private variable.

We will then run a movement script with a transform.translate

Now we can move our object through our scene.

Unity Developer and Software Engineer who loves making games with GameDevHQ