How do I translate a BodyVelocity script to LinearVelocity?

Hello people! I have a problem updating a previous model in the past which I can not get to work because of BodyVelocity being deprecated.

local bv = Instance.new(BodyVelocity,bullet)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = (aimer.CFrame.LookVector + spread) * 300

The bullet doesnt do anything other than stay there which is very infuriating as I worked a lot on it. I believe linearvelocity is the translation but there is a lot of complicated scripting. It asks for an attachment, select the attachment and a lot of weird stuff. Can someone help?

body velocity works exactly the same as vectorforces so use that

if you are making a bullet projectile i suggest you use fastcast, it is very performant and wont lag your game (depending on how you set it up)

making a bullet move through body velocity/vectorforces is not a good idea and the best way to do it is through cframes and raycast (what fastcast does)

local Attachment = Instance.new("Attachment") 
Attachment.Parent = aimer

local ForceV = Instance.new("VectorForce") 
ForceV.Attachment0 = Attachment
ForceV.RelativeTo = "Attachment0"
ForceV.Force = Vector3.new(-math.huge,0,0)
ForceV.Parent = aimer
3 Likes

Thanks, I will see a tutorial for it. I will use VectorForce for now while I figure out how to use raycast!