- Home /
Lights that ignore position.z of GameObject
Hello everyone!
I'm creating a 2D game. I've set an Orthographic Camera. The game uses meshes (not sprites) to render GameObjects. This GameObjects are ordered by position.z in order to not overlap. I've set an Spotlight, and Point light
If I raise this beautiful blob "transform.position.z -= 2f" above the ground, it is close to the light source, so this happens.
Is there any kind of light that ignore the z position of the object? I know that Directional lights don't take into account the position of the object, but I don't have the same control as in Spotlights (all the Scene is lit). Is this possible with custom Shaders?
On the other hand, is there any option of sorting layers for MeshRenderers, as in SpriteRenderer? This may solve this problem too.
Thank you!
I kinda solved it by using a Directional light with a Cookie in the shape of an halo, and modifying it's size and intensity.
Thanks anyway!
Your answer
Follow this Question
Related Questions
Select 2D Object By Mouse ? 4 Answers
2D Layering Issue 0 Answers
Unity 2D Shader (or mask) to Render Over Sprites of a Certain Layer 0 Answers
How to animate collider along with object for 2D game? 1 Answer
2D (With Planes) Jump Script 0 Answers