I have a script that “throws” a part, its not the best, i want to make it as accurate as possible, how could i do this?
this is a snippet of the script and the code i want adjusted.
RemoteEvent.OnServerEvent:Connect(function (plr, SetPosition, LookVector)
local NewSpell = spell:Clone()
NewSpell.Fire.CanCollide = true
NewSpell["Sphere.001"].CanCollide =true
NewSpell["Sphere.001"].HandleWeld:Destroy()
NewSpell.Parent = game.Workspace
NewSpell.Fire:SetNetworkOwner(plr)
NewSpell["Sphere.001"]:SetNetworkOwner(plr)
NewSpell:PivotTo(CFrame.new(SetPosition))
local LV = Instance.new("LinearVelocity")
LV.Parent = NewSpell.Fire
LV.Attachment0 = NewSpell.Fire.Attachment
LV.MaxForce = 500
LV.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
LV.LineVelocity = 500
LV.LineDirection = LookVector + Vector3.new(0, 0.5,0)
task.wait(0.2)
LV:Destroy()
end)