0 votes

I'm trying to implement a tilemap for top down game with different height levels. It is also required to display the light correctly: Light2D must affect only cells located on the same or lower levels. And it must also produce shadow from the cells of the next higher level. My current solution uses multiple layers of TileMap's with different light_mask and occluder_light_mask values. Each TileMap represents corresponding height level. Border cells have a square occluder. This works when there are only 2 levels but with 3 and more levels I face the issue that can be seen on the following screenshot:

enter image description here
As you can see there are 3 height levels and the hero with its flashlight is on the 2nd "floor". The problem is that shadows from the 3rd floor cells aren't shown on the 1st floor. I've experimented with TileMap's and occluders and it seems that shadows aren't drawn on empty cells (pretty obvious). And in my case those cells representing the 1st floor are empty for other 2 TileMap's. This is the cause of the issue. So, can you please give me an idea of how I can overcome this limitations?

P.S. Sorry for my english.

in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.