2d Animation not playing second scene

31 views Asked by At

I created a new animation for meteor GameObject , the animation functions in first scene normally, but the second scene is not playing regularly: video explanation of the problem

I think the reason for this problem is timeScale , and I added this code from meteor object:

void Start()

{

Time.timeScale = 1f;

}

The problem is not fixed by this.

1

There are 1 answers

0
Display name On

Animations are triggered by setting the value of an Animator object.

I.E.

[SerializeField] Animator anim;

void SetFields()
{
    anim.SetBool("flagName", true);
    anim.SetFloat("flagName", 0);
    anim.SetInteger("flagName", 0);
}

In your first screen, you must have some script that is setting the field of your meteor animator which has not been added to your new scene