So my problem deals with instantiating objects into a scene. If I have the ambient light turned on, all instantiated objects are lit when instantiated. I don’t want to use ambient lighting however.
I’m doing a 2d game and using a directional light to emulate the ambient light–but setting it to specific layers so each background layer can be lit darker than the foreground.
So I’m instantiating bullets that are set to their own layer with a directional light that is set to the same layer yet they aren’t lit by the light. If I set another object that isn’t instantiated to that same layer–it is lit by the light when the game starts rendering.
The only solution I’ve found–which doesn’t work actually–is instantiating a light with the instantiated bullet–it works sometimes–and half the time the bullets still aren’t lit or turn off halfway through their lifetime.
So is this a bug in Unity?