Animation Control by Float
Hello there, im kinda stucked in my project where everything is controled by one global float which is always an value between 0 and 1. So basically the float moves from 0 to 0.1 and so on, till it reaches 1, then it goes back to 0 (like a pulse).
So far so good, the problem is that i want to attach an animation to this and have no idea how to do that. The basic idea is that when the float is 0 - the animation is is on its first frame, when it reaches 1 - it will be on its last frame.
Im using unity 4.1 and c#, but its ok to switch the version to a newer one if necessary.
I hope someone might help me :( Thank you in anticipation!
Answer by OctoMan · Jul 20, 2017 at 01:00 PM
Ints are only full numbers! So it can only be 0 or 1 but nothing in between. I believe you mean floats? If not, make all floats.
The rest is mathmatical stuff.
Animation Frame Count / 100 = a float value which represents 1 frame.
yes i meant float, sorry :D im kinda new to program$$anonymous$$g. So how can i play the animation frame by frame-like?
Answer by UnityCoach · Jul 20, 2017 at 02:37 PM
It's probably easier to use the Legacy Animation component than the Animator component for this.