- Home /
Mecanim Axis Randomize Input Problem
Hello everybody,
I have a problem with my y-axis input.
After I press the up key, the dirY variable is jumping between many random numbers, thus playing my combat_walk animation many times (the animation isn't seen because of the high frequenzy of the change) and playing back my footsteps sounds.
the dirY variable should have a range from -1 to +1. I checked my rootmotion-script, but couldn't find anything.
Update: After a while the dirY variable stays at a larger number than 1.0.
Best regards 0tacun
i have found an workaround for me: ins$$anonymous$$d of using the 1D-Blend Type, use the 2D Freeform Cartesian. This prevents the occuring footstep sounds while standing still, but doesn't solve the input problem.
You'll need to show the bit of script that sets the dirY parameter...
if (!isDefending && !isAttacking && !isDashing) {
v = Input.GetAxis("Vertical");
h = Input.GetAxis("Horizontal");
animator.SetFloat("dirY", v, 0.1, Time.deltaTime);
animator.SetFloat("dirX", h, 0.1, Time.deltaTime);
if ( h < 0 )
transform.Rotate(Vector3.up * 4 *(h));
else if ( h > 0)
transform.Rotate(Vector3.up * 4 *(h));
}
nothing fancy here. By the way: In the picture you can see, that the dirY parameter is set to zero. In the Blend Tree it is a weird number.
Your answer
Follow this Question
Related Questions
Benefits of root motion 1 Answer
setting animation transition times to joystick float values 0 Answers
Animation and joystick Input 1 Answer
Handling input, movement, animation with scripts? 1 Answer
Clear mecanim trigger input? 1 Answer