Guys, i’ve 2 animations on objects and now i dont know how to compare them.
The first is a spawning (1-20) - it must come when object spawns. And the second is idle (21-180). The second animation is looping.
How can i set auto-change animation from spawning to idle?
Several ways to do that.
First, you need to make sure the default animation is the spawning and that playOnAwake (or automatically, I allways forget which one) is enabled.
Then, at start, call a coroutine waiting for that first animation’s length, then play the idle. Crossfade if they don’t match.
Or, you could use a higher layer for the spawn animation and constantly call CrossFade( “Idle” ) in update. The spawn animation’s wrap mode must be Once though.