How could I play an animation from a way of moving my joystick on controller?

I want to be able to make my player do a certain animation when i move the 4th and 5th axis of my controller. I want to get the same result like in skate 3 when you move the 4th and 5th axis in a certain direction which makes the character do a certain trick.

Also what is this feature called with the aid of activating an animation with the movement of the joystick.

1 Answer

1

I have no idea if this feature has any name, but if you just think about what you have, it should become apparent what to do:

Each stick has two axis. Each is a float that ranges from -1.0 to 1.0. -1.0 would be negative and 1.0 positive. Now you would just decide in which range each axis value has to be for the animation to start. If it should play when the stick is held up-left, then it would be horizontal < 0.0f && vertical > 0.0f.