- Home /
Making a culling mask from tags instead of layers
Hi,
I'm in a bit of a spot. In my current project, I have several objects in each scene that each have their own camera focused on them. Each camera needs to see only its target object, the output of which is then used in RenderTextures elsewhere.
these objects come into close proximity, so to prevent them from bleeding into one another's camera views, they can't all be on the same layer. I thought about doing some fancy code that switches nearby objects to always be in different layers, but I'm not sure how possible that would be, plus it would clog up my user layers that I could use for other things.
So, is there any way to construct (in C#) a culling mask for a camera based on tag, rather than layer? I heard a tip that this may be possible, but tedious. If so, that seems like it would solve things over here.
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220613110401im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to Choose Camera for Game Window 2 Answers
Seperate Shadow Strengths from different objects? 0 Answers
Can't add custom tags 3 Answers
How to find one object in specific layer? 1 Answer
Two Objects in the same position? 0 Answers