I am trying to spawn different instances of the same object. This object (GeoObject) has an animation in which it goes through four different shapes (Square, Circle, Triangle, Star, in that order). However, I want each instance to start at a different shape in that loop. From doing some research, I realized that the simplest way to do that would be to set the NormalizedTime of the animation to a random float value. But the line of code I added to do that doesn’t seem to have an effect. I’m throwing the code below:
public Animator anim;
// Use this for initialization
void Start()
{
anim = GetComponent<Animator>();
// Need to write code to create each GeoObject with a different initial shape
anim.Play("BlueBlobAnimation", 0, Random.Range(0f, 1f));
// Slows down the animation speed relative to game's framerate
anim.speed = 0.05f;
}
I would really appreciate if someone could help me out with this. Thanks!