How to test if a player is looking at a part. And how to remove parts from being walls

Ima just make this quick. I need to make SCP 096 work. What i mean is to make the scp 096 work when the player is looking at it. But i want the script to ignore stuff like glass and doorways that might get detected as a wall. Read [GT-6887] for more info

[GT-6887]
So. What im looking for in more depth. Lets use SCP 173 for example. When the player is looking threw a doorway since its a blender type model roblox counts this has a fully filled part. Which means scp 173 will move if the player goes through a doorway making the game harder and unrealistic to what would happen.

What i need is a way to ignore parts that i dont want to be counted as a wall. Like glass where scp 173 will stop and not follow the player.

I think using tags would work. But i havent really tried yet because im more working on graphics if there is anyone to help me i would be very happy!

1 Like

What parameters are you using for the raycast?
Yup, you could use tags to create a table of the parts you want to be ignored during the raycast blacklist.
Or you could use the raycast result and check materials too.

I believe this is done by Dot product take a look at this Dot Product