Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to activate no gravity that is local to the player?

Asked by 5 years ago

I'm making a space game where players start from the ground where there is gravity, but when they reach a certain altitude, how would I make it so that the gravity is turned off for that player? Other items do not have to be in low gravity as it's only the ship that is moving which is moving at a constant speed, just the player to experience 0 gravity, thank you in advanced!

1 answer

Log in to vote
1
Answered by
blockmask 374 Moderation Voter
5 years ago

Btw, I'm not giving you a script, just an idea on how to do it. This is scripting helpers, not script givers

This can simply be done with workspace's gravity property. The default gravity is 196.2, and in a server script, you'd want to constantly check the character of the player's head for the Y CFrame or Position, and then once that level reached your goal, then fire a remote event for the client, to activate no gravity

Here's a couple of scripts:

--Server
remote:FireClient(player)
--Client
remote.OnClientEvent:Connect(function()
    workspace.Gravity = 0
end)

I hope this helped

0
I see you're being careful with the whole rules stuff ;) but I thought I could mess around with all that Client Only stuff, cheers! Marmalados 193 — 5y
0
No problem blockmask 374 — 5y
Ad

Answer this question