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");
}
}