Animator.SetTrigger not working
2. Srpen 2024 v 05:49
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: