FreshRSS

Zobrazení pro čtení

Jsou dostupné nové články, klikněte pro obnovení stránky.

Animator.SetTrigger not working

I'm new to Unity. I'm trying to create a black screen transition when pressing a button using SetTrigger(). However it's not working. It doesn't even play at the start of the game. Can anyone help me?

Here is my code:

// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown("x")) {
        Debug.Log("Hello");
        anim.SetTrigger("Crossfade");
} }

My settings:

enter image description here

enter image description here

enter image description here

❌