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

Player looks at something to cause an event?

Asked by 5 years ago

How would I be able to make an event happen if a player were to look at something? An example would be like a player looking at a picture that causes their vision to blur, etc.. Would this deal with LookVectors or something?

0
possibly. My best guess is to have a LocalScript check the camera's position every time it changes, calculate what is inside the field of view, and if the thing you are trying to get is, then fire a BindableEvent. RiskoZoSlovenska 378 — 5y

1 answer

Log in to vote
-1
Answered by
Benbebop 1049 Moderation Voter
5 years ago
Edited 5 years ago

Yes, ClickDetectors have an event that triggers when the mouse is hovered over the object.

local Click = -- your ClickDetector --

function Click.MouseHoverEnter:Connect(function()
    -- Your Code when the player is looking at it --
end)

function Click.MouseHoverLeave:Connect(function()
    -- Your Code when the player looks away from it --
end)
0
no, gamemaster does not want an event to fire when the player hovers their mouse over something. he/she wants to fire and event when a certain part comes into their field of view - simply when they see it. RiskoZoSlovenska 378 — 5y
Ad

Answer this question