- Home /
Instantiated objects, not reacting to lighting
Hi, I'm building a Horror game and have spotlight coming from the weapon, for testing, I already have a prefab of the enemy alive at start which reacts to lighting all fine, however, when the other enemies are instantiated they do not react to the lighting the same way the enemy already alive does. How do I make the lighting so that these instantiated objects are affected by light in the same way?![alt text][1]
My current light settings: [1]: /storage/temp/73888-screenshot3.png
I remember reading something about lighting not working correctly sometimes in the editor (and have actually experienced this quite a few times).
Do you experience the same problem when building the game and running it?
I just tested this in a new build, and it's exactly the same, where only the prefabs in game on start work with it, and the instantiated don't, however looking into this, my bullet prefabs look like they have lighting, even though they're also instantiated. Very Strange.
We don't have enough information: what rendering path are you using? Is this the only light in the scene? How many pixel lights are allowed in your quality settings? What shader is assigned to the material on the objects being instantiated?
Ok, Render path is forward, there is two lights in the scene; one spotlight, one point light, but both with same settings. I'm not sure about the pixel lights. And the material is : Sprites/diffuse. However as I said earlier, I have a prefab already in there at start and lighting works on it, but not the instantiated versions of it.
The lights don't work even if you position the instantiated prefabs at the exact same spot as the one that was already in the scene?
Yep, still nothing, ill attach a picture to show the difference, sorry if it's kind of dark.
Basically, in the picture the two enemies closest to the player, are the instantiated versions, and the one at the back is the version in game at start. The lighting hits the start up version, but somehow ignores in some sense the instantiated ones.
Answer by willaay96 · Jul 15, 2016 at 03:01 PM
I think I've found the issue, the instantiated objects Z position is getting set to -1.9 when they spawn.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Instantiate random platforms 0 Answers
Is it better to use ParticleSystems on one GameObject OR instantiate ParticleSystems? 1 Answer
Argument Exception: The Object you want to instantiate is null (A new one?) 2 Answers
Spawn multiple enemies in relation to gameobject [SOLVED] 1 Answer