2D Dynamic Lights (2DDL) – FAQs

 

- Why 2DLight show some artifacts or mesh glitch in scene? 

This can happen when 2DLight game object and colliders aren’t in the same Z position, please check that the Z be the same in all objects that interact with the 2DLight.
Another issue could be huge collider in regarding Light radius, in this case make sure that this collider don’t be close too much to the Light.

 

- Works in Perspective Camera ?

Yes!, Perfectly.

- Can it use with 3D Objects ?

Yes, but need a 2D Collider be setted properly in the same depth that 2DLight resides.

-Can I use 3D Colliders within Game Objects ?

Sorry but no. 2DDL Doesn’t support 3D Colliders

 -  How can i do for that some objects react to the light and others do not ?

By default, any new casters is assigned to “ShadowLayer” layer. You can put object inside this layer or put off for control casting interaction in relation to 2Dlight.

- My GameObject don’t cast any shadow.

Check if is inside “ShadowLayer” layer.

- Why the 2DLight mesh is over my sprite ?

Probably you had a bad sorting order in sprite renderer. Try change this value to another high number.

-Can the same “Polygon collider 2D” used for shadows respond to events 2D physics?

Yes, without any inconvenience.

-Why an object that is in the shadow of another is not hidden by that shade?

Because 2DDL is a Light System, the shadow is an effect produced by object that stopped the light rays. In other words, like a real light. Can get this effect with a special setup, see “Visibility” in Documentation.

-Why the Casters has the Collider component like a child GO ?

This is for 2 reasons, one for avoid error when “ObjectReached” param in Optimizations and second, for prevent collider auto generation with unity engine.

 - Can I use gradient with depth mask shader in Visibility demo example ?

No, for the moment.

- Can i use 2DDL in Z pos !=  0 ?

Yes, from the version 1.3 and considering same Z pos for the casters.

 - Can I change the 2DDL transform scale ?

No, you Can’t. This will produce unstable results. Use the Radius property instead.

 - Can I use 2DDL in X/Z axis ?

Sorry but No for the moment, but i have plans to add compatibility with flip XZ  <-> XY in the future.D

- Why i am detecting some glitches when i try to animate 2D Light GameObject with Unity Animator ?

Because 2D Light GameObject need to be moved with NO Interpolation. Change “Update Mode” to “Animate Physics” inside Animator inspector, solves the problem.

image

- Why do i detect some glitches when i try to animate 2D Light GameObject with Unity Animator ?

Because 2D Light GameObject need to be moved with NO Interpolation. Change “Update Mode” to “Animate Physics” inside Animator inspector, solves the problem.

– Similar situation to the previous question, Why do I detect some glitches when i try to animate a 2DLight GameObject with RigidBody2D component ?

Because 2D Light GameObject need to be moved with NO Interpolation. Change Interpolate Field to “None”.

rect2996

If You need Some Interpolation Value, check “6.1.(Interpolate confflict)SOLVED” under Examples Folder.