Input seemingly not working with trigger

For some reason when I tried to add an input to a trigger area as to activate a door animation, for some reason that does not work.

However when I check and unchecked the state of the door animation that does work.
There’s a boolean variable called “DoorState” that controls the door animation in the script.

I first tried to use the input script within the collision detect area however that did not seem to work, so I moved it to the function update area with a variable called “PlayerCollision” that is only set to true when the player walks into the trigger area / false when not.

I am also new to the question area, sorry if there is incorrect formatting.

Should also say that it is javascript

here is the code :

Found it. You might have problem in your Update function when you press the input button. As your code would always return to false. From line 30 to 36

Try doing it this way.

if (DoorState == false) { // A little more simple way would be: if(!DoorState)
     DoorState = true;
} else {
     DoorState = false;
}