Frictional Games Forum (read-only)

Full Version: Door Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is the situation:


I have a key that I pick up, and a door behind me. I want to code it to find out if the door is closed, to open it, and if it's open, to close it. I'm not sure if this would be an actual "if" statement, but the way I'm looking at it it would sound like one.

I'm just having trouble combining the functions to make one, or having one call the other.

Thanks!
If the door is in state 1, set state 0. If it's in state 0, set to state 1. Have a timer to check these statements.

If you don't know how to make an if statement, use the wiki and study.
Excellent, thanks! Will post results.
Disregard this, I apparently can't delete posts. :I
You don't have a timer to check it. You need a timer to check if it's open/closed every, lets say, .5 seconds.
A timer is not required if they're depending on player-area collision. Also, AddPropForce is required to open the door further than what SetSwingDoorClosed can.
Decided to go a different path with how the door is going to interact. Marking this as solved, thanks for the help you two.