Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to get the direction the mouse is pointing to?

So I'm making a tool that allows players to grab objects and throw them around. When an object is grabbed, it will have a BodyPosition inserted into it that moves the object in the direction the mouse is pointing to, by a certain amount. Letting go of the object would remove the BodyPosition.

However i am struggling to find a way to get the direction the mouse is pointing to when it is over the skybox. Mouse.Hit returns nil when over the skybox, and the UnitRay property of the mouse doesn't seem to change when the mouse is over the skybox.

Thanks

2 comments

0

Mouse.Origin does not change when the mouse is over the skybox, as well

0

Mouse.Hit does not return nil, it is a CFrame value.

1 answer

Solved, the other solutions I had above all work fine, my code for some reason was structured to do nothing when there was no Target. forgive my stupidity lmao

This discussion is preserved as it was. New answers, comments, and votes are closed.