the error is: bad argument #2, to ? (Vector3 expected, got number)
local tgt1 = m.Hit.p
v.velocity = tgt1*100
Other things you should know before you call me out on it: 1: I left out most of the script on purpose, and left these two lines as they are linked as a problem. And I know that everything is defined. v is a bodyvelocity object m is the mouse of the player
First off, .p is deprecated, you should be using .Position, and velocity should be .Velocity. It would also be best to use a LinearVelocity object instead of BodyVelocity.
Regarding your problem, my tests show that code works as expected. (as in it does not error)
No it would be different. There is no property that calculates mouse direction.
But you can probably do something like this
local X,Y
Mouse.Button1Down:Connect(function()
X,Y = Mouse.X,Mouse.Y
end)
Mouse.Button1Up:Connect(function()
local XDir,YDir = Mouse.Position.X - X,Mouse.Position.Y - Y
--XDir and YDir are the direction of the frame
end)