Okay, nevermind.
I gave the BodyVelocity a small MaxForce but with a lot of Power
It works pretty nicely.
Thanks!
Okay, nevermind.
I gave the BodyVelocity a small MaxForce but with a lot of Power
It works pretty nicely.
Thanks!
I know this post is old but I wonder what the maxforce should be to able to move the humanoidrootpart and not make it glitch. Iâve tried different amount of maxforce, some to low that it doesnât move the char and some to high that make the char glitch, so what is the right maxforce
Depending on how youâre applying the force, you will need to get the mass of the objects in the character. That can be done by doing Part:GetMass()
Youâll simply need to do a for loop through all the characterâs parts to sum them all up. Then just use that to apply a force depending on the mass.
I think that might be the solution, hereâs the code, I might be doing something wrong which is why is probably why is not working for me.
edit:The thing that isnât working for me is that the player character doesnât move
local Speed = 200
local Vector = player.Character.HumanoidRootPart.CFrame.LookVector
local Mass = 0
local objects = {}
for i, v in pairs(player.Character:GetChildren()) do
if v:IsA("Part or v:IsA("MeshPart") then
table.insert(objects,v)
end
end
for i, v in pairs(objects) do
local mass = v:GetMass()
Mass = Mass + mass
end
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = Vector * Speed
BodyVelocity.MaxForce = Vector3.new(Mass,Mass,Mass)
BodyVelocity.Parent = player.Character.HumanoidRootPart
wait(0.1)
BodyVelocity:Destroy()
There is a mass because I tried printing the mass and it isnât nil
Multiply the mass by a force constant. Can be anything from 0 - infinity.
So I actually found out that glitching wasnât from the bodyvelocity but instead it was probably from the animation. Since the animation moves the character forward and when it hit things it glitches, so now I have a total different problem lol.