Applying Smooth Movement

Now that we’ve covered Action Maps and how to assign keys for specific functions, let’s apply movement to our player.

I will create a new Input Action by going to the Project Panel and selecting Create > Input Actions.

Create a new Action Map and name it Player, then create a new Action and name it Movement.

Under the Action Properties, set the Action Type to Value and the Control type to Vector 2.

The next step will be to add a Binding to the Action and now that we’ve set the Action Properties to Vector 2, we should now have the option to select the directional Composite.

This will define the Movement and will allow us to set our inputs to up, down, left, and right, and we can assign those to the classic WSAD keys.

With the Binding selected, the Binding Properties now become available in the next window. Since we created and Binding Composite Type set to be a 2D Vector, the Composite is automatically set to have the 2D Vector Composite Type.

Below the Composite Type, we have the Mode. The Mode has three different options for us to select from. I have Digital Normalized selected meaning that since it is Normalized, the movement in all directions will be the same distance no matter which direction you are applying.

Read More