How do I make something activate when player look at the thing

  1. What do you want to achieve? Keep it simple and clear!
    How do I make something activate when player look at the thing

  2. What is the issue? Include screenshots / videos if possible!
    I can’t find any tutorials, posts about it. I am also not very good at scripting so I don’t know how to do it

  3. What solutions have you tried so far?
    Haven’t found a solution

(I’m not asking for the entire script, I’m just asking for what should I look into or how do I make it)

1 Like

Try scripting it so that if the humanoidrootpart of the player’s character’s orientation is the same as the part orientation. If it is, then do some code. I believe this is how it should work:

local part = --path to part

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)

while task.wait() do
local hrp = char:WaitForChild("HumanoidRootPart")

if (hrp.Orientation == part.Orientation) then
-- code
end
end
end)
end)
1 Like