What I do is when you click the button, it changes a variable. And so that will say if an animation should be changed a.k.a. if the door is open or closed.
Variables are kind of an important thing for my fnaf game. If one of them is off by just one, it's broken.
i also have to handle idiots on the G developed website because of the fact that people can't read descriptions. So I'm updating the game to tell you to read the description.