• Zero gravity on Players?
    8 replies, posted
Is there a way to at least replicate the effect of zero gravity on players? I've tried countering their Z velocity but it's really hacky and unreliable and practically locks their Z axis.
Have you tried ply:GetPhysicsObject():EnableGravity( false )? I don't even know if a player is a physics object though ply:SetGravity(0.00000001) kind of replicates the results
I tried both of those, and neither of them worked.
There's no easy way. You'll have to code most of the movement and camera stuff from scratch, and even then it probably won't work that well because players should be able to rotate around and that means you'd have to change the way collisions work because player collisions are normally determined by axis aligned bounding boxes, which cannot rotate. It's a huge pain in the ass. You can somewhat make it simpler if what you're trying to do stays in singleplayer, or if there is a very small chance for two players to collide with each other. Then you could probably use a simpler collision detection system. But either way, there's no magical way to do it.
Try ply:SetGravity( 0.25 ) and remember to define ply with local ply = LocalPlayer()
[QUOTE=AIX-Who;42443426]Try ply:SetGravity( 0.25 ) and remember to define ply with local ply = LocalPlayer()[/QUOTE] SetGravity is a server-side function, LocalPlayer is a clientside function. This won't work.
Works fine for me in my gamemode.
Try "player:SetMoveType(MOVETYPE_FLY)" - players will be unable to use WASD if they touch the ground if their movetype is movetype_fly though
[QUOTE=DrogenViech;42444699]Try "player:SetMoveType(MOVETYPE_FLY)" - players will be unable to use WASD if they touch the ground if their movetype is movetype_fly though[/QUOTE] No, you can turn still turn in mid air when you use that movetype on yourself. Haven't you ever played surf? >:). Actually, you can also change the pitch of your velocity vector too if you spam space and look around. [editline]9th February 2014[/editline] Not very space-like
Sorry, you need to Log In to post a reply to this thread.