Hey there, i am trying to make a part that is completely unaffected by gravity, but I am having issues.
The old method of removing gravity from a part (creating a body/vector force that is equivalent to the workspace’s gravity * the part’s mass on the y axis) seems to not work anymore, I have tried multiple variations of it but to no avail. the part just always flys away
Using a body mover/vector force is the only solution atm (I’d suggest vector force). Could you provide some context to the situation so we can figure out what is causing it to fly off? My guess is the part’s velocity is already set to something before you add the vector force. This would just cause the part to move in that direction forever. If you want to make sure it doesn’t move when you add the vector force, try setting Velocity and RotVelocity to Vector3.new(0,0,0)
Massless is just for mechanisms where the root part has a mass, the connected parts with Massless true don’t add to the total mass, e.g. bodykit for a car where you don’t want it to affect the handling.
The usual method that uses a BodyForce works for me; perhaps you’ve done it incorrectly. Could you try inserting this Script into the Part to see if it works as expected?:
local parent = script.Parent
local bodyForce = Instance.new("BodyForce")
bodyForce.Force = Vector3.new(0, parent:GetMass() * workspace.Gravity, 0)
bodyForce.Parent = parent
When I was working on solving a problem with establishing a way a player could be made to go up and down via q and z keys and hover when required I had to add a variation on the mass * gravity setting.
The variation I used was to multiply the calculation by 0.999972 and discovered by experimentation.
I have just tried the rbxl I created and its still works fine and the hover is stable for my specific setup.
Anchoring means that the object is no longer affected by anything, and from what I can tell, he wants it affected by everything but gravity, so it’s not an option.
That problem is probably if not definitely the issue of the humanoid. It’s his head. I haven’t had issues with this so I can’t really help out with this.
local bv = Instance.new("BodyVelocity")
bv.Velocity = Vector3.new(0,0,0)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)--Play around with this
bv.P = 9000--Play around with this
bv.Parent = part