Frame control

Hi,

I’m working on a versus fighting game. With these types of games, I need a full control over the frames of animations. I can’t use the technique of animator.speed because it’s a float approximation from the normalized value of the animation length. Ok, this animation is at frame X, so I stop this animation and play the other or, this animation is at frame Y so I freeze time for Z frames, etc…

My problems are :

  1. I need to dynamically speed/slow some animations (block stun) depending on the frame data of the opponent when he hits. I don’t see how to achieve that without frame control on the animator.
  2. I need frame precision to handle cancels, links etc…

I have a dream where I can access everything from the standard arnimation view from Unity by script (scrubber, current frame number, stretch group of frames…).

Does anyone faced this problem already or have a solution ?

I don’t have experience with fighting games like you are trying to do but I think what you want to use is AnimationEvents.

https://docs.unity3d.com/Manual/animeditor-AnimationEvents.html

You can also use AnimationState.NormalizedTime.

Read through the docs and see if either of those will do what you want.

1 Like