Does anybody have a solution?
I’m trying to get the script to check if the door is open, if so pressing E will close it and vice versa.
if (Input.GetKey (KeyCode.E) && (gateOpen == false)) //check for key press
{
print ("e was pressed to open");
gateControl ("open");
gateOpen = true;
}
if (Input.GetKey (KeyCode.E) && (gateOpen == true)) //check for key press2
{
print ("e was pressed to close");
gateControl ("close");
gateOpen = false;