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

I was wondering how I would change a player's gravity when their X position changes?

Asked by
flameko 14
5 years ago

I was looking into the wiki and could not find much information on the topic. I'm not asking for code, just asking for a push in the right direction.

1 answer

Log in to vote
0
Answered by 5 years ago

I've answered a question similar to this.

After checking the wiki I found this.

script.Parent.BodyForce.force = Vector3.new(0, game.Workspace.Gravity, 0) * script.Parent:GetMass()

You could do an if statement,


if game.LocalPlayer.Character.HumanoidRootPart.Position.Y:GetPropertyChangedSignal() then game.LocalPlayer.Character.BodyForce.force = Vector3.new(0, game.Workspace.Gravity, 0) * game.LocalPlayer.Character.Parent:GetMass() end
0
Simply edit the values and you should be good to go. TheGalaxyRBLX 222 — 5y
1
Lots wrong with your code. User#19524 175 — 5y
Ad

Answer this question