So, I used to have this system for a game where you could make a spell cast towards the mouse position using body velocity, and it was a OK. But only recently did I want to remake this system to find out that Body Velocity is deprecated and I wanted to try out the new “Improved” version LinearVelocity. I’ve been trying to figure out how I could achieve a similar result but to no avail.
This is the old code I used to work with
local velocity2 = Instance.new("BodyVelocity", bh)
velocity2.Velocity = CFrame.new(bh.Position, mousepos).LookVector * 100
velocity2.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
mousepos in that script is equal to mouse.Hit.LookVector, although I could change that if needed.
My question is how would I make it so that the linear velocity goes in the direction of the mouse position.