- Home /
Help with layers?
Hi all, i was wondering if some one could help me. Basically the question is i have a object and it has a layer on it called wall. Now what i want is you see how the camera has a Culling Mask and it allows to to pick what layers the camera will avoid how can i do this to an normal object so it can avoid objects that have layers on them please help me thank you very much in advance :) MCHALO
Answer by CHPedersen · May 09, 2011 at 06:18 AM
You simply select the layer that particular object is in. For a GameObject, look in the inspector, second line from the top. By default, it'll be in the "Default"-layer. Expand that dropdown and select another layer, then remove that other layer from the Camera's culling mask. That camera now no longer renders that object.
Edit:
For the usage of Layers in collision detection, you can refer to this article, from Unity's documentation:
http://unity3d.com/support/documentation/Components/Layer%20Based%20Collision%20detection.html
It still wont work the player will still collied with the object. i need the main object to avoid the wall not the cam
Aaah, sorry, I didn't read your question properly. Take a look at this article: http://unity3d.com/support/documentation/Components/Layer%20Based%20Collision%20detection.html
It explains layerbased collision detection.
Well, you could add it to your answer and you get your upvote ;)