- Home /
Hide an object from one camera but not another
I have two cameras on my scene at all times. One shows a side view, and one shows a top-down view. I also have objects in my scene that are visible.
However, I can't figure out how to hide one object (for the sake of this question, let's call it a cube) from the top-down camera but keep it visible in the side view camera (if I use SetActive(false)
on the cube, it disappears from both cameras).
Is there some way to set the cube to transparent or hidden in the top-down camera but full view in the side camera?
Answer by tanoshimi · Jul 21, 2016 at 09:54 AM
Yes. You set one camera to cull the layer on which the object is placed, and the other not to. https://docs.unity3d.com/Manual/Layers.html
That's exactly what I need. And it's an easy thing too! Thanks!
Answer by RoyUV · Jul 21, 2016 at 08:42 AM
Watch this tutorial about 30 minutes in.
http://unity3d.com/learn/tutorials/topics/graphics/using-cameras?playlist=17102
Yep, it would be that simple lol
For future reference the layers tutorial starts at 44:50 for setup, 47:15 for actual example
Your answer
Follow this Question
Related Questions
CustomAxis sort not working between objects placed at different layers rendered by multiple cameras 0 Answers
How to hide elements behind a transparent panel 0 Answers
Does the Particle Animator work with transparent shaders? 1 Answer
Different transparency on same texture? 1 Answer
Is there a way to make a jpeg texture transparent for black? 2 Answers