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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem With "AddPlayerBodyForce" Func
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#2
RE: Problem With "AddPlayerBodyForce" Func

You're using values like 2.0, and -4.0. To get any significant result, I needed to go as high as 500.0, or 2000.0 (in some cases, 4500.0).

Not only that, but i had to apply that value every twentieth of a second!

Essentially, you're giving the player a very light breeze every second for a brief instant of a moment. You need to apply a much, much higher force over the course of a longer period of time.

Also, while this is a matter of preference, I prefer using the same function for timer situations like that, and just tell them apart using the timer name. "if(asTimer == "PlayerMoveTimer4"){...}" kind of deal. It keeps the code less cluttered for me, in more ifs and less functions.

For example, this would apply a force of 500 whatever's to the player in the X axis every twentieth of a second for 1 second:
void PushPlayer(string &in asTimer)
{
     if(GetLocalVarInt("PushingStage") == 20)
     {
          AddPlayerBodyForce(500.0f, 0.0f, 0.0f, true);
          AddLocalVarInt("PushingStage", 1);
          AddTimer("Blah", 0.05f, "PushPlayer");
     }
}

It's your job as a script writer to find a way to work in that idea though, always the hard part.

As per the room... mind clarifying a little?
10-24-2010, 02:52 AM
Find


Messages In This Thread
Problem With "AddPlayerBodyForce" Func - by Kyle - 10-23-2010, 11:58 PM
RE: Problem With "AddPlayerBodyForce" Func - by Entih - 10-24-2010, 02:52 AM



Users browsing this thread: 1 Guest(s)