• 2D
  • Help! Light 2D is not working!

The thing that has me exasperated is that I have already successfully implemented Light 2D in another project with no problem. I followed the same process exactly and made sure the light mask I created was made to fit the viewport. But this time it is not working at all!

When I use it in Add mode, there is no effect, no matter how I tweak the energy, color, texture scale, or z-index.

And when I change to Mask mode it blocks everything out entirely!

The only thing I can think of, which just now occurred to me as I'm writing this, is that I added this as a child of the root node which is just the generic "node". Maybe it has to be added to a specific type of node? Someone please tell me if I missed something here, this is driving me mad!!!

Why not test it by changing the type of your root node?

I did and it still didn't work. BUT.......just a minute ago I figured it out! I was on to something, assuming it had to do with node types, but it wasn't a problem with the node I attached it to, but rather with the Sprites within the node that I wanted to be effected by the mask......

To test my suspicion, I created a simple tile map and covered the screen in tiles. Sure enough, the Light2D interacted with the tiles perfectly. See, this is going to be a title screen and I have layers of sprites to animate doors opening and light shining through. So I assumed I would want to use parallax layers for each part of my background. I now realize that Light 2D does not interact with parallax layers like this. So once I moved the sprites out of the parallax layers, they were all effected by the light mask as you would expect. A frustrating, but educational experience.

Hopefully if another newcomer has this same problem, they'll see this discussion and avoid unnecessary hours of frustration! (note and compare my scene hierarchy from the previous screen shots)