I have an object that has an animator, inside has one simple animation, move up and down in loop and other animation which is IDLE, no movement at all.
Now I want to have a lots of this same object jumping up and down, but each of them will make transition from idle to movement at different time so i have this script attachet to them
public float AnimationStartOffset;
public Animator animator;
private float next_start_floating;
private bool isStart = false;
// Use this for initialization
void Start () {
next_start_floating = Time.time + AnimationStartOffset;
}
// Update is called once per frame
void Update () {
if(Time.time > next_start_floating && !isStart)
{
animator.SetBool("IsJumping", true);
isStart = true;
}
}
I set the offset value differently to each object, but the animation of some objects are always start at same time, I also try to the the transition to no exit time, and using StartCoroutine, but the result is same.
Please help