I have a T-Pose character and a series of up to 20 separate animations.
I can load the animations in and apply them to my t-pose using the simple crossfade commands to change animations nicely under player control.
I now need to test for the length of any particular animation which I play so I can crossfade to another animation at an appropriate moment, without a pause.
For example, I have 5 idle animations, if I try to randomly select the next idle animation to play, there is a slight pause - because I have set the wrapmode to once (not loop) so that I can test if the animation is playing or not. The issue here is once it is not playing - the slight pause causes the animations to stop between each idle (obviously!), where I really want them to smoothly crossfade without any pause in fluidity.
My thought was to set the wrapmode to loop and then simply test for the length of the animation currently playing, so I can crossfade once it has looped once. However I can’t seem to figure out how to achieve that.
Can anyone help please? Is my approach incorrect? I know there is an animation clip .length property, but I haven’t made my animations into clips as that seems a little more involved and unnecessary.
Thanks,
IPete2.