BodyForce Gravity not working

hi, BodyForce isn’t working and here a script:

local part = script.Parent
local downForce = -part:GetMass()*workspace.Gravity
local force = -downForce
local bodyForce = Instance.new("BodyForce")
bodyForce.Force = Vector3.new(0,force,0)
bodyForce.Parent = part

robloxapp-20210331-1155558.wmv (872,6 KB) robloxapp-20210331-1155253.wmv (52,2 KB)

i want to walk i a wall but it dont work, i want an earth where can you walk without falling in the void, like you’re pasted and you cant jump

I’m learning slowly, don’t complain if I can’t

Mind explaining a bit what are you trying to achieve? What is that part supposed to do?

robloxapp-20210331-1207482.wmv (1,2 MB) like this

This script should work fine:

local part = script.Parent
local bodyForce = Instance.new(“BodyForce”)
bodyForce.Parent = part
local bodyForce.Force = Vector3.new(0, part:GetMass() * workspace.Gravity, 0)

no is giving aan error Syntax error, Got

Hi! You would check out this, Wall stick/Gravity Controller

Give credits to their owner, @EgoMoose.

Here is [Example Source] Smooth Wall-Walking "Gravity Controller" from Club RAVEN by @EmilyBendsSpace.

hey, i don’t to download/ use models. i want to learn

1 Like

hey, sorry, I messed up with the code I wrote earlier, you can try this:

local part = script.Parent
local bodyForce = Instance.new(“BodyForce”)
bodyForce.Parent = part
part.BodyForce.force = Vector3.new(0, part:GetMass() * 196.2, 0)

1 Like

local part = script.Parent
local bodyForce = Instance.new(“BodyForce”)
bodyForce.Parent = part
local bodyForce.Force = Vector3.new(0,
part:GetMass() * workspace.Gravity)

Would work fine I think.

1 Like

nothing, not work, and i don’t know why :confused:

Try this one:

local part = script.Parent
local force = Instance.new("BodyForce")
force.Parent = script.Parent
force.Force = Vector3.new(0,part:GetMass()*workspace.Gravity,0)
1 Like

no, but i insert those script in the Part, is correct?

Yeah you should insert this in the Part. Also this will not work in anchored parts

If you want this to work in models, you have to calculate the total mass of the model (All the parts inside it).

ohhh thats (maybe) why, let me try

1 Like

robloxapp-20210331-1234182.wmv (2,2 MB)

So, are you trying to make the part float in mid-air, but without changing the world gravity or are you trying to make a wall walking gravity controller?

yes, i posted a video of what i needrobloxapp-20210331-1207482.wmv (1,2 MB)

EgoMoose already made a post on this, you can click here for more help: Wall stick/Gravity Controller

1 Like

But it’s the same as above … However I don’t use stuff from GitHub

It’s not easy to do what egomoose is doing there - he’s not just applying a force, he’s doing all sorts of hidden stuff behind the scenes to make it seem like you’re stuck to a wall when you’re really not.