Hey Guys,
I have been trying to make a third person controller from scratch and i got success with it but there is an issue with the Animator Controller I found that doesn’t affect the logic what so ever but I found this bug intimidating. Any help to Sort this out will be helpful.
Thanks in Advance
The Bug: I am setting the Animator Parameter - Vertical with playerAnimator.SetFloat() playerAnimator.SetFloat(vertical, snappedVertical, 0.1f, Time.deltaTime); - not works
Do you need the third and fourth transition arguments? If you use them, it becomes up to you to update it every frame until it arrives in the neighborhood of what you expect.
You’ll also notice that there is no “equals” with floating point properties in the Animator transition, only greater or less than. Usually a tiny number like 0.01 or 0.001 is used for “reached zero.”
This is because you cannot reliably test floating point numbers for equality, and that also applies to in code.
Here’s why:
Floating (float) point imprecision:
Never test floating point (float) quantities for equality / inequality. Here’s why: