Why is bodyvelocity deprecated when it does more than linearvelocity?

So i’m making magic system and I need my fireball to just travel in a straight line without falling. Body velocity achieves this while a linear velocity is affected by gravity and it falls.

Now I know roblox says bodyvelocity shouldn’t be used in new work, but it’s so convenient to just stick it on the fireball and call it a day rather than find out why linear velocity is not working the way I want it to.

3 Likes

Have you tried messing around with VectorForce?

To counter the force of gravity? The issue is that I have to know the mass of the fireball I spawn and I don’t know how to calculate that, it’s a model with a lot of parts

You could choose a single part to have mass, the rest massless and use that part only in order to calculate the mass.

Oh i see, i’ll go try that then.

idk what to do

mass of the primary part is 140, workspace.gravity is 196.2. so i multipled them and got 27468

then i made a vector force with the values 0, 27468,0 and set it relative to world and put it into the primary part. but the fireball still falls.

edit: nevermind

never mind i fixed the floating issue but for some reason changing the bodyvelocity to linearvelocity isn’t going smoothly. I changed everything correctly I think but the fireball won’t move forward anymore. What a headache.

local fireball = workspace.MagicAttack:Clone()
local hrp = player.Character.HumanoidRootPart
fireball.PrimaryPart.CFrame = hrp.CFrame
fireball.PrimaryPart.CFrame = CFrame.new(hrp.Position.X, 5, hrp.Position.Z) * hrp.CFrame.Rotation
fireball.Parent = workspace
	
local debounceTable = {}
fireball.PrimaryPart.Touched:Connect(function(otherpart)
	if (game.Players:GetPlayerFromCharacter(otherpart.Parent) == player) then
		return
	end
	local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
	if (humanoid and debounceTable[humanoid] ~= true) then
		debounceTable[humanoid] = true
		humanoid:TakeDamage(10)
	end
end)
local bVelocity = Instance.new("LinearVelocity") --this was a body velocity before.
bVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bVelocity.VectorVelocity = Vector3.new(hrp.CFrame.LookVector.X, 0, hrp.CFrame.LookVector.Z) * 40
bVelocity.Parent = fireball.PrimaryPart
fireball.PrimaryPart.Anchored = false
game:GetService("Debris"):AddItem(fireball, 1)
3 Likes

I’d have to do testing of my own but I’m not at my PC and won’t be for a while, my apologies.

1 Like

Did you forget to set Attachment0 here?

1 Like

yeah i thought that was the problem too so i changed it to have that but it still didn’t work

does attachment 0 have to be pointing in the direction i want the primary part to go?

1 Like

no its just supposed to be attached to the part u want to move

I just noticed that when apply linear velocity to a character, it makes character play running animation. is there way to not trigged the running animation.

A bit late reply but I think if you just use the humanoid setstateenabled method you can stop the running animation from playing.

Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)

Roblox has been shifting toward a constraint-based physics system, which is more efficient and prevents weird behavior at high speeds. The old BodyMover system (including BodyVelocity) was completely phased out because it became unstable and didn’t offer precise control.

2 Likes