Raycast not working correctly

I’m trying to make the player’s screen turn red whenever it sees the rig, and i want it to not be able to turn red whenever it is behind a wall. I’m currently using this script (it’s in a local script):

I’ve tried to use a Raycast to check if it hits a wall or not, meaning if it will turn red or not. But it works only when i look at some specific directions. Any help?

This is what it looks like in game by the way:

1 Like

change the second raycast parameter to this:

workspace.Dumih201.Head.Position-character.Head.Position

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