Frictional Games Forum (read-only)

Full Version: Door Slowly Opens.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, can anyone provide me with a script that will make a door slowly open when I walk towards it? That would be great!

-Angerpull Angel
Use these functions to make the door open.

SetSwingDoorDisableAutoClose(string& asName, true);
SetSwingDoorClosed(string& asName, false, false);
AddPropImpulse(string& asName, float afX, float afY, float afZ, "World");

Fiddle with the float values to make the door open. Look at the door in your level editor. The blue line is the Z axis, the red line is the X axis. You'll probably not need any Y value (green line) unless you have a door leading through the roof or something weird like that.
Code:
AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
asName - the object to push
afX - direction along the X-axis
afY - direction along the Y-axis
afZ - direction along the Z-axis
asCoordSystem - determines which coordinate system is used, usually “world”

You have to use quite big numbers for doors, I think, but if your float isn't that big, it should open slowly Smile
For a door, try the force of 1 - 3 in the correct direction. When I tried 5, it blasted open and closed fast... :/