What is the best way to enable no gravity for players?

I need a better way to do this, I’m trying to use player:SetGravity( 0.000001 ).

The problem with this is if you jump, you kinda just float away at a silly velocity for a long time. Where as if you use PhysObj:EnableGravity it doesn’t do that.
On the wiki it has stated that it is impossible to get exactly 0 gravity using player:SetGravity.

How can I get the same affect of PhysObj:EnableGravity on the player.

So you’re trying to have ZERO gravity, or low, moonlike gravity?

If you’re having problems with your players jumping with too much power, try setting their jump power using **[Player.SetJumpPower

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.SetJumpPower)**

I’m not sure if you can have zero gravity on Quake Physics entities like you can with Valve Physics entities. But hey, you can try to simulate it.

I’ve never used PhyObj:EnableGravity before, so what exactly what do you mean?

If you want the player to come back down, then the problem with your question is that if there isn’t any gravity, the player isn’t supposed to come back down. The entire reason you come back down after jumping on earth is because gravity exerts a force on your mass toward its core.

If you want the player to travel upwards using a less “silly” velocity, I suppose you could change the jump power as Bel Irkalli stated.

A player, or anything that doesn’t use VPhysics doesn’t have a physics object. PhysObj:EnableGravity takes a bool, and enables or disables gravity for that Physics Object’s entity accordingly.

Yes, but what are the effects of doing that in this situation? A less “silly” velocity? They come back down?

shrug It’s different, as the wiki says, but I’ve never tried to do it. Let’s just take their word for it and assume the object isn’t truly unaffected by gravity.

I want it so you can float around without flying off like a rocket

Yeah your best bet is passing SetJumpPower on every player. 200 is the default, so set it to something like 100 or even 50.

I have it set to 20.

Still doesn’t make much sense.

Zero gravity is exactly that, a lack of gravity entirely.

Any force applied to any object will cause that object to travel infinitely in the direction of the force applied, until stopped.

Sounds like you want some kind of a jetpack feature, enabling the player to apply force to himself in the direction of his choosing, in which case… I’d start with CreateMove().

Try player:SetMoveType(MOVETYPE_FLY)

[editline]15th January 2012[/editline]

You will be able to conrol your movement in the air a bit, you won’t drift into infinity

took a combination of a few other things but it ended up working good, thanks. I was using movetype_fly_gravity or w/e