How do you use linear velocity

Linear velocity requires an attachment. To use it, you first have to insert an attachment in the part you want to move and then set the LinearVelocity.Attachment0 to that attachment.
A simple example can be:

-- you need to define the player first
local HRP = player.Character.HumanoidRootPart

local Part = Instance.new("Part", workspace) -- the part to move
Part.CFrame = HRP.CFrame * CFrame.new(0,0,-3) -- Putting the part infront of the player

local Attachment = Instance.new("Attachment", Part) -- the attachment used in Linearvelocity

local LV = Instance.new("LinearVelocity", Attachment) -- creating the linear velocity
LV.MaxForce = math.huge -- no need to worry about this
LV.VectorVelocity = HRP.CFrame.lookVector * 100 -- change 100 with how fast you want the projectile to go
LV.Attachment0 = Attachment -- setting the attachment

game.Debris:AddItem(Part, 2) -- deletes the moving part after 2 second
49 Likes