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) - Removing or manipulating gravity physics
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#7
RE: (Script help) - Removing or manipulating gravity physics

Pretty much got it, for anyone who may be interested in the answer, this is what I did

To test, I made a floating bottle. Very exciting stuff. Thanks Palistov for the timer value.

void OnStart()
{
AddTimer("floatbottle", 0.0166, "floatbottle");
}

void floatbottle(string &in asTimer)
{
AddPropForce("floatingbottle", 0, 19.7, 0, "world");
RemoveTimer("floatbottle")
AddTimer("floatbottle", 0.0166, "floatbottle");
}

And lo, the bottle did float

This is the right amount of force to keep the bottle perfectly still in midair. When you grab and throw it, the effect of there being no gravity is pretty much as perfect as you could want it, but it will need to be applied to each entity individually by adding them into the looping function. No idea what performance implications there could be, but I intend to test that soon. When the bottle breaks, the pieces still fall downwards which kinda spoils the effect somewhat.

I can also get the player to float, by adding 'AddPlayerBodyForce(0, 1400, 0.0, false)' to the function, similar to what Elven did in the 'Floating Tongue' thread, but you can't control yourself properly in midair, so I'm not sure its all that useful.
03-03-2012, 07:44 PM
Find


Messages In This Thread
RE: (Script help) - Removing or manipulating gravity physics - by Adrianis - 03-03-2012, 07:44 PM



Users browsing this thread: 1 Guest(s)