Hello guys!
I’m facing some issue at the moment with my character controller. I made a finite state machine to separate each behaviours (idle, walk, attack …). When a condition is met, the character state changes, as well as the animation. The animations are set according to some booleans. When the character exit a state, the current state boolean is set to false and the next state boolean is set to true (which will trigger the next animation).
One of my animation is currently facing some issue (Default Attack), which is trigger when the player click on the left mouse button. When my default animation is done, I will like to return to the previous state. In order to do so, I checked if my normalized time of my animation is higher than 1. If that’s the case, I know that my animation is done.
If the player re-click on the left mouse button while he is on the previous state, the default attack animation will immediately transitions to the previous state because the normalized time of the default attack is higher than 1. It seems like the attack default animation is constantly playing (even if the LOOP checkbox is not checked). In order to reset the normalized time of the default attack animation, I have to go to the previous of the previous state and then come back to the attack animation.
For example, if my player is walking and then the player click on the left mouse button to do the default attack, I will have to go the previous state (walking) then I will have to go to Idle, then return to walking and re-click on the left mouse button top reset the normalized time of the default attack animation…
I simply don’t understand why the animation normalized time is not reset to 0 when the animation is done.