How to open a door with the "E" key

I have a door that is animated. The door opens from frames 1 to 32, then closes the door at frames 36 to 56.

From my understanding you are able to stop the animation at a certain frame, then start it again when you press your key.

I want to be able to press “E” and the door opens. The animations stops at frame 32. Then press “E” again to close the door. (Start animation at 36 and stop it at 56. Once you close the door. I want to be able to press “E” again and the animation starts again at frame 1.

I have the door rigged and imported into unity. The door is named “Door1”.

I am not a programmer. I am an animator and do not know javascript well. If someone could point me in the right direction that would help out tremendously.

you need to go to your update function and do something like this :

void Update()
        //call your door opening animation
        //set isDoorOpen to true
        //call your door closing animation
        //set isDoorOpen to false

Basically that’s the idea.