How to make material fade behind objects?

I’m trying to make a security camera that you have to avoid. I’m using a large cone with a material applied to it so you know where the camera is looking at. Unlike the spotlight however, I can’t seem to get the material to fade behind the walls.

Doesn’t really make sense for the camera to see behind the wall, which is why I need it to fade completely when a specific area of the material hits the wall just so the player isn’t like, “Hey, how is the camera looking beyond the wall?!” (Even though it isn’t.)

If it sounds confusing, then here is a picture of the desired result:

I would use a spotlight only, but it doesn’t have light rays or anything that shows where the light is starting from, which is why I’m using a spotlight and a cone.

I’m not sure if this is actually possible via materials, but if it isn’t, are there any other solutions to this problem?

Nevermind. I managed to figure it out myself while I was making other things.

The Deets: