Hello i have i weird issue when am trying to get the current animation normalized time its never correct
private float CalculateNormalizedTime()
{
AnimatorStateInfo currentStateInfo = stateMachine.Animator.GetCurrentAnimatorStateInfo(0);
AnimatorStateInfo nextStateInfo = stateMachine.Animator.GetNextAnimatorStateInfo(0);
if (stateMachine.Animator.IsInTransition(0) && nextStateInfo.IsTag("Attack"))
{
Debug.Log("in transtion: next " + nextStateInfo.normalizedTime +" current " + currentStateInfo.normalizedTime);
return nextStateInfo.normalizedTime;
}
else if (!stateMachine.Animator.IsInTransition(0) && nextStateInfo.IsTag("Attack"))
{
Debug.Log("not transtion " + nextStateInfo.normalizedTime);
return currentStateInfo.normalizedTime;
}
else return 0;
}
debugging values for the last animation noramllized time 0.039 and the current is .69