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

How can I cancel vertical gravity properly? [solved]

Asked by 3 years ago
Edited 3 years ago

Right now I'm trying to cancel it by doing this binded to RenderStepped:

function cancelgrav()
    game.Workspace[game.Players.LocalPlayer.Name].HumanoidRootPart.Velocity = Vector3.new(game.Workspace[game.Players.LocalPlayer.Name].HumanoidRootPart.Velocity.X, game.Workspace[game.Players.LocalPlayer.Name].HumanoidRootPart.Velocity.Y + (game.Workspace.Gravity - game.Workspace[game.Players.LocalPlayer.Name].HumanoidRootPart.Velocity.Y), game.Workspace[game.Players.LocalPlayer.Name].HumanoidRootPart.Velocity.Z)
end

but it just ends up accelerating upwards and the difference never reaches 0 like it should.

0
you can try using body force or changing the world gravity with a local script MacGames007 114 — 3y
0
I don't want to change world gravity as I want it to affect other stuff. But I have used a bodyforce and it worked. Thank you! :D boomthefist 6 — 3y

Answer this question