- Home /
How to last value of Get Axis after the button is released
Hi all
I'm trying to make my top down character stay in idle position after all the buttons have been released.
I've created a blend tree with all the animation needed in 8 direction.
I get my animation blend tree parameters from the Controller script with the following code:
_movement = new Vector2(Input.GetAxis("MoveHorizontal"), Input.GetAxis("MoveVertical")); //I make a character move
``` _animator.SetFloat(FaceX, _controller._movement.x);//I path the parameter to the blend tree
_animator.SetFloat(FaceY, _controller._movement.y);
And everything is working just fine when I move my character with keyboard or gamepad.
However the issue i'm facing is the following:
After I release the buttons character returns to a default position (as GetAxis at this moment are equal to zero both x and y).
Is there a way to get "the last axis value before releasing an axis button" in Unity?
Your answer
Follow this Question
Related Questions
Dynamically add AnimationState to Controller 0 Answers
Top-down character running animation based on facing direction 0 Answers
Does Unity have ANY support for ANY Thrustmaster products? 0 Answers
mesh replacement deletes animation 0 Answers
Can the animation editor create local rotational data? 3 Answers