Upgrading Player Movement (New Unity Input System)

Upgrading Player Movement (New Unity Input System). (UPDATED)

In the first step, we will create GameInputActions and generate its C# scripts.

In the next step, we need to create an action map, an action with composite binding of Vector3.

I HAVE DELETED SOME BINDING UP AND DOWN SINCE WE DONT NEED IT FOR PLAYER MOVEMENT.

Now create an action map variable and enable it on the start method.

Now go to the movement method comment on the vertical and horizontal input, then read the value of the action.

Then replace the float value of h(horizontal) with “move.x” and v(vertical) with “move.y”.

Let's see the result.I tired to update this using Vector3 but the result is the same so id does not matter unless you need 3 Vector to the control player.

See you at the next one.

--

--

Suleiman Abdullah

Self taught Unity Developer, who is passion about making games ,and he loves Math For Game Development