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

How to find where the mouse is pointing towards?

Player = game.Players.LocalPlayer
Player:GetMouse()

--Problem, what do you use and how do you find where the mouse is pointing towards?

1 comment

0

Mouse.Hit is the CFrame of the position the mouse is on, Mouse.Target is the part it is on.

1 answer

You would use, mouse.Target, and mouse.Hit, these Properties have different and intricate usages, 1. Target is the object that the mouse is interacting, and 2. Hit is the position of the mouse.


local mouse = Player:GetMouse()

if mouse.Target == workspace.Baseplate then
	print("hit")
end

1 comment

0

Hit is actually a CFrame value, to get the position you do Hit.p

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