- Home /
Canvas layer overrides child layer in light culling mask - Expected behavior?
I am trying to cull which objects inside my UI Canvas receive lighting using the gameobject.layer property. I have noticed that the layer properties of all children of the Canvas objects seem to be overridden by the Canvas's layer.
Is this intended behavior? If so, why are children of non-Canvas gameobjects allowed to have different layers?
Here's my simple scene hierarchy and light (culling mask set to LitUI):
"Parent Object" is just an empty gameobject, while "Canvas" is a Canvas. Both "Parent Object" and "Canvas" have their layer set to "UI". Both "Westley" child objects have their layer set to "LitUI". Only the "Westley" who is a child of "Parent Object" receives lighting.
Anyone know what's going on here?
Your answer
Follow this Question
Related Questions
How can you hide Canvas objects using Camera Culling Mask? 1 Answer
Display a world-space canvas to overlay all the meshes but not the other UI objects 0 Answers
How to display 3D object on top of UI World Space Canvas in VR 0 Answers
UI Text overlaps by a Plane. 0 Answers
Using HDRP, why does my UI block light making everything around it dark? 2 Answers