Disabling physics for the local character

Is there a way to disable physics on a local character? something like Humanoid.PlatformStand but when its enabled the character doesn’t have any gravity affecting him?

1 Like

Use a local script to disable gravity

workspace.Gravity = 0

im surprised the solution was that simple

2 Likes

Hmm, if you set gravity to 0, all instances turn weightless that you create/ move to workspace with a localscript, which can be a bad thing. I’ve just pieced together some code, but this should make you weightless.

Character = script.Parent
HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
Descendants = Character:GetDescendants()

Mass = 0

for i, v in ipairs(Descendants) do
    if v:IsA("BasePart") then
    Mass = Mass + v:GetMass()
    end
end

local AntiGravity = Instance.new("BodyForce") do
    AntiGravity.Force = Vector3.new(0, Mass*workspace.Gravity, 0)
    AntiGravity.Parent = HumanoidRootPart
end

2023/03/28 edit:
Since Part.AssemblyMass is a thing now, getting the total mass is trivial.

local Character = script.Parent
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Mass = HumanoidRootPart.AssemblyMass

local AntiGravity = Instance.new("BodyForce")
AntiGravity.Force = Vector3.new(0, Mass * workspace.Gravity, 0)
AntiGravity.Parent = HumanoidRootPart
6 Likes

Thanks, i appreciate it a lot.

No problem, good luck with whatever you want to use this for. :slight_smile:

1 Like