1
\$\begingroup\$

Suppose you have two directional lights pointing at one sphere from different angles. You would expect the sphere to cast two shadows, but it turns out that this isn't the default behavior. The first light in the scene is the only one that casts a shadow. I want all my yellow spheres to take shadows from light A, but I want all my blue spheres to take shadows from light B instead of A. Is there a way to do this?

(It seems there's a fullforwardshadows pragma that could make the spheres cast both shadows. I'll try to figure that out if need be, but I really only need one shadow per sphere.)

\$\endgroup\$
1
\$\begingroup\$

Yes, you can configure your Lights to affect only certain objects, by using Layers.

Assign your objects to a specific Layer (you can use an existing layer or define your custom one). Then, in Inspector pane, use Light's Culling Mask setting to set which Layers you want it to affect.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.