Shadow doesn't work if another light is created before shadow casting light?

It’s “by design”, the ShadowOnlyMaterial assumes it should use the first light of the light list.

You can set the light you want to use by setting ShadowOnlyMaterial.activeLight, and the code will make sure this light will be the first of the list:

2 Likes