Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get the position of the mouse?

Asked by
816i 19
7 years ago
Edited 7 years ago

Im making a script that has a lerp that will of course move the block to your mouse position in the game, but I cant seem to figure out how, If you know please answer! Thanks

EDIT: Spelled answer wrong.

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

You can index the Hit property of the Player's mouse from a LocalScript.

local mouse = game.Players.LocalPlayer:GetMouse()

print(mouse.Hit.p) --'.p' to convert from CFrame to Vector3
Ad

Answer this question