How to move part using velocity to ray hit?

Hi,
I want to raycast and then move an object using basepart.velocity towards the ray hit. Think of throwing a ball, raycasting to get the hit and then using velocity to move the ball to ray hit to make it look like the ball was thrown. How would one do this?

bump, if bumps even work here lol

Well, it entirely depends on the scenario you want to approach it on

Are you wanting to get the Mouse’s Position for casting the Ray’s Direction?

No, i already have the ray casted. What I need to know is how to move a part to the ray hit using velocity

I believe you could just set the AssemblyLinearVelocity property & assign its variables to the Direction that was cast by the Ray, if that’s what you’re getting at? Of course, you’d probably need to implement a sanity check if the Ray did hit a Part Instance or not

local RayInstance = RayResult.Instance

if RayInstance then
    RayInstance.AssemblyLinearVelocity = Direction
end

Either that or you could use a BodyVelocity to move the Part