Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

2 comments

0

Simply edit the values and you should be good to go.

1

Lots wrong with your code.

This discussion is preserved as it was. New answers, comments, and votes are closed.