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

How to find where the mouse is pointing towards?

Asked by 8 years ago
Player = game.Players.LocalPlayer
Player:GetMouse()

--Problem, what do you use and how do you find where the mouse is pointing towards?
0
Mouse.Hit is the CFrame of the position the mouse is on, Mouse.Target is the part it is on. TheDeadlyPanther 2460 — 8y

1 answer

Log in to vote
0
Answered by
rexbit 707 Moderation Voter
8 years ago

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
0
Hit is actually a CFrame value, to get the position you do Hit.p DevSean 270 — 8y
Ad

Answer this question