Search code examples
unity-game-engineanimationstatetransitionanimator

Animator SetFloat(int 0) as Transition, now to prevent looping?


I change the value instigating the transition via SetFloat() and this works fine. The transition occurs. It is set to take about half a second, it does that, the next animation state plays to completion and it correctly returns to the default animation.

However, because the float trigging transitions has been set to a value that creates a transition, the transition occurs again.

How and when do I reset the Float to a value that doesn't trigger a transition without otherwise ruining a currently occurring transition and completion of the animation?

The float value is used to determine the speed of the animation state's playing, hence using it instead of a trigger.


Solution

  • You could use both a trigger and a float in your transition's conditions.