How Would I Get It So That When I Look At A Part Something Happens

I want it so that when I look at a part something happens. Like those scp 096 models: when your character (not your camera) looks at it it will start chasing you something like that. I don’t know where to start and I suck at coding so I’m posting here if you know anything please do reply thanks

You could raycast from the front of the player’s face and check if the hit object is the character you want to detect.

1 Like

Try looking into raycasting and something else with the humanoid

1 Like

There is an pretty simple way, it’s not the best, and it can only really be used once. But put a click detector inside the head or part that you want the player to be able to look at, and inside a script use the .MouseHoverEnter function to detect that. You can also set the click detectors max distance to 10000 and also change the click detector cursor image to the asset ID 1. If you do this then players won’t notice you have a click detector. But if you want more accurate then use raycasting from the players head.

1 Like

I will use raycasting since they could just go in 3rd person but Thanks!

1 Like

Thank You For Letting Me Know Where To Start

1 Like

Thanks! You Guys Are A Big Help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.