- Home /
Lights attached to objects turning off over terrain
Hi all. I think this is probably a bug in the engine, but I am new to using Unity and wanted to get your opinion before bothering the developers with a bug report.
I have "defenders" that get instantiated, and they instantiate projectiles, kinda like magic bolts or missiles. These projectiles are textured spheres made in unity that have a particle emitter and point light attached to them. They fly forward over a board composed of individual flattened cubes also made in Unity.
Everything works fine until the spheres pass the board and are over the terrain. At this point if only one projectile is over the terrain the light stays on. If 2 or more are past the board, only the first one has a light on. Even more confusing, the projectiles die automatically after 5 seconds, and once the one with the working light is destroyed, the light on another one over the terrain turns back on. The projectiles and board tiles have colliders but they do not touch each other.
Does this sound like a bug in Unity, or did I likely miss something stupid that I did?
Thanks in advance, guys...
Answer by Malaclypse · Sep 21, 2011 at 01:05 AM
Under Edit->Project Settings->Quality there is a "Pixel Light Count" setting. Mine was set too low. Raising it fixed the problem.
Thanks to all who read my post.
Answer by asafsitner · Sep 20, 2011 at 05:35 PM
Sounds like forward lighting to me. Try switching to deferred lighting. Edit -> Project Settings -> Player -> Other Settings -> Rendering Path
As for why they die off after 5 seconds, check your projectile code and collision. Maybe they don't die but instead go 'inside' the terrain?
Sorry, I can see now that I was unclear about the projectiles dying. They are set to do that automatically so they don't fly into space forever if they don't collide. I will definitely try the deferred lighting when I get home though and let you know. Thanks
Asafsitner, your answer did not solve the problem. I'm not sure if it just wasn't it, or if it is because I am using basic, and not pro. Your answer did lead me to the solution though, and I am greatful.
Thank you.
I tried to give you a thunbs up, but my karma must be too low or something. If someone with more karma doesn't $$anonymous$$d, could you do it for me? Thanks