I have an animation set to “wrapMode=WrapMode.Loop”, what I want to do is update a variable at the end of the animation loop. I have tried checking the variables “animation.time” and “animation.normalizedTime”. The problem is that both of those variables keep counting up continuously as long as the animation is playing.
normalizedTime is supposed to give a value between 0 and 1, but it doesn’t. It gives the same incrementing variable as “animation.time” does.
Any idea if I am not using normalizedTime correctly or is there another way to detect the loop point of a looping animation?
we suppose a varriable “T” that will increase forever from 0 to infinite,
if i want to check for example when “T” is looping at a specified value “L” i would do :
if (T % L == 0) // actually it calculates the reste of the perfect division of T / L
But T and L must be integers, if not , u can use Mathf.floor to switch from float into an integer value .
Thanks. I was thinking of doing something like that. I just thought something so useful would be included in the unity scripting language. I’m also surprised that normalizedTime doesn’t work the way says in the documentation