Did i get how GetNormalizerTime() works correctly?

So after many Debug.Logs and rewatches of the lecture, i think i got we went to that much trouble for the normalized time but I want validation. So when we are lets say in idle state and its normalized time has progressed far, if we press the mouse button the current state is still idle for a few frames in the Animator’s idle state while in our statemachine we are in the attack state thus resulting getting the normalized time of idle’s state where we need the attack state’s normalized time which start from 0


Yes, that sounds about right.
When we switch to a different state with a different animation, the two animations are blended together to make a smooth transition. We immediately switch to the next state in the player state machine, but the animations take a little time to transition.
If we are still in that transition (and the next state has the tag we require) we return the normalised time of the next state because that is our attack animation and the one we care about.
If we are not in the transition it means we are already playing the attack animation (if it has the tag), so it is now the current state and we want that normalised time.
All this was really to ensure that we are getting the normalised time of the attack animation regardless of whether or not we are still transitioning to it, or not.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms