Simple Animator Script Not Working

Update: It turns out it was the lowercase U in the Update function and I’m just dumb. I’ll leave this up for a day so everyone can laugh at me before I delete it.

I’m not sure why this script isn’t working, but I can’t even get the debug logs to work under the update function. This is a script for a door that opens and shuts, and the public voids at the bottom are so I can later instances to trigger them in other scripts. the GetKeydown functions in the Update field are just to test if I can get the animations to play, but I’m not getting animations there or the debug logs. The scripts are attached the door, the door has an Animator component, the animations are programmed. I’ve gone over this script a dozen times and can’t figure out why it’s not working.

public class Door : MonoBehaviour
{
    Animator anim;
    
    void Start()
    {
	anim = gameObject.GetComponent<Animator>();
    }

    void update()
    {
		if (Input.GetKeyDown(KeyCode.H))
	    {
		Debug.Log("IsClosed");
		anim.SetTrigger("isClosed");
	    }

		if (Input.GetKeyDown(KeyCode.L))
	    {
		Debug.Log("IsOpen");
		anim.SetTrigger("isOpen");
	    }
		
    }
	

    public void CloseDoor()
    {
	anim.SetTrigger("isClosed");
    }

    public void OpenDoor()
    {
	anim.SetTrigger("isOpen");
    }
}

Fist you could print you Animator to see if it is instanced correctly:

void Start(){
     anim = gameObject.GetComponent<Animator>();
     Debug.Log(anim);
}

Then your Update-Funktion should be like this:

void Update(){  // not update()

}

Next test if the Debug.Log in your Update-Function is working. If your doesn’t work already maybe try setting your trigger manually (not by code, but manually in your Animator). There you can also see if the trigger changes when clicking the key.


Hopefully it’s working. Happy coding and greetings from Germany.