Frictional Games Forum (read-only)
Open a door with script - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Open a door with script (/thread-6123.html)

Pages: 1 2


RE: Open a door with script - GraphicsKid - 01-10-2011

(01-09-2011, 03:36 PM)Andross Wrote:
Code:
AddPropForce("MyDoor", 100.0f, 0.0f, 0.0f, "World");
That's how I implemented it successfully at various locations (as well as the developers Smile).
The example assumes that your door swings open towards the x-axis. If I remember it correctly, 100.0 is not enough to open the door completely, so you might have to either call this multiple times by means of a timer or adjust the force value.

Figure out what force you have to apply to it to get it to open when the door object's y rotation is 0, then just change "world" to "local". Then you don't have to worry about having the force in the right direction, as it's local and will rotate with the door.