- Home /
Animator question: need to play animation ONLY if current animation is at a particular frame
I am making a VR FPS for android (daydream). This question is regarding gun animations. I have made all the animations I need to create realistic gun animations, similar to Crysis (PC video game). I need animation transitions to be absolutely seamless. I am aware that I can use blend trees, but am more comfortable with the simpler solution- to only allow an animation to be played if the last animation has competed. All of my gun animation start and end in the same exact position, across all animations. This way, if I ensure that animations only play when the gun is at the start/end position/rotation, there will be no sudden jumps when changing from one animation to the next. How do i do this? How do tell an animation to play only after the previous animation has reached its end (or a specific keyframe, since most of animations loop, so there is no real end)? Is there a simple, built in way to do this, before i start thinking too complex? (using animation events to change bool variable to allow for next animation to be played. checking if transform is in the start/end position before applying the next animation ).
I noticed the animation class has a PlayQueued function, which plays an animation only if the current one is completed. But is it possible to use this function in Unity 5, in conjunction with an animator component? How?
Answer by theANMATOR2b · Jun 02, 2016 at 04:57 PM
I answered this in the forums - look into has exit time - in the documentation. If your looking for a more complicated code setup, maybe someone else has a suggestion.