Turn off the display layer on the camera

Hello. When I click on a certain button, I need to display everything in the scene except the “Ignore Raycast” layer. How can I do this through a script? Thank you in advance for your reply.

I’d assume you’d do it by changing Camera.cullingMask. I haven’t done it in script, so I can’t give you the exact code to use.

You could also do it by keeping all the Ignore Raycast objects in a list and just disable all their renderers.