Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help [SOLVED] AddBodyForce doesn't work
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: AddBodyForce doesn't work

(09-06-2012, 06:35 PM)Kiwi2703 Wrote: Hey Smile
I have an area called ScriptArea_2. I want the player to be pushed forward (about 1 meter) and slighty upward (~0.2m) when he collides with the area.
The script looks like this:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_2", "theforce", true, 1);
}

void theforce(string &in asParent, string &in asChild, int alState)
{
AddBodyForce("Player", 0.0f, 500.0f, 5000.0f, "world");
}

I set the values so high only for experimental purposes. The problem is, when I walk into the area, absolutely nothing happens.
Any help? Thanks! Smile
I don't see anything wrong with this. Have you created the script file while the map was open in Amnesia? If yes, close Amnesia, then start it again.

Also, are the names correct? Triple-check, to be sure.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 09-06-2012, 06:43 PM by Robby.)
09-06-2012, 06:38 PM
Website Find


Messages In This Thread
[SOLVED] AddBodyForce doesn't work - by Kiwi2703 - 09-06-2012, 06:35 PM
RE: AddBodyForce doesn't work - by Robby - 09-06-2012, 06:38 PM
RE: AddBodyForce doesn't work - by Kreekakon - 09-06-2012, 06:44 PM
RE: AddBodyForce doesn't work - by Kiwi2703 - 09-06-2012, 06:52 PM
RE: AddBodyForce doesn't work - by Robby - 09-06-2012, 06:56 PM
RE: AddBodyForce doesn't work - by Kiwi2703 - 09-06-2012, 06:59 PM
RE: AddBodyForce doesn't work - by Robby - 09-06-2012, 07:02 PM
RE: AddBodyForce doesn't work - by EXAWOLT - 09-06-2012, 06:44 PM
RE: AddBodyForce doesn't work - by Robby - 09-06-2012, 06:48 PM
RE: AddBodyForce doesn't work - by EXAWOLT - 09-06-2012, 06:51 PM
RE: AddBodyForce doesn't work - by EXAWOLT - 09-06-2012, 06:52 PM



Users browsing this thread: 2 Guest(s)