Mouse's position is considered a number value?

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

1 Like

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)

Mouse.Hit.Position is the position the mouse hit and no the direction the mouse is pointing too.

You should use mouse.UnitRay.Direction

How would i do so a imagelabel follows mouse position

local tgt1 = m.UnitRay.Direction
v.Velocity = tgt1 * 100

yes but in uidm2 would be the same?

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)