How do I fix the lighting on my level 1?

Okay this is going to sound crazy, but for the life of me I can’t comprehend how this issue could have happened.

I was designing my second level to have trees. The trees have light obstacle enabled, and are a global object. I’ve also programmed the light to follow the player, be a global object, be on a z order lower than the player, too. All of the major programming involving the lighting is in a folder, shared by both scenes, ‘Level 1’ and ‘Level 2’. I already double checked, and there is nothing different in the 2 levels involving the programming, and light obstacles.

I was designing my Level 2 scene, and decided to just copy and paste all my work from Level 2, into Level 1. Including my trees, which were not in Level 1 originally. And this has been happening.

(Level 1 is where the lighting issue is, where Level 2 looks just as I want it too)

I’ve never encountered an issue like this, and I feel like I’m crazy. Is there something I’m missing? Is it possible I glitched it? I don’t see anything in my programming, or anything differently done from Level 1 to Level 2. Is it something easy I forgot to check? I don’t want the light to glow on the outside of the tree png, so. I just, I’m absolutely confused.

Any help would be appreciated! Thank you!

Hi!
Can you circle the issue you’re having on your screenshots? :sweat_smile:

Oh my goodness, of course! I was rushing because I had to get on a plane in a few minutes.

Yeah for some reason the glow around the character clips through the visuals in level one, but not in level 2. It’s so strange and I’ve gotten real good at Gdevelop by now, so I haven’t been completely stumped in a long time. Here is also a gif to show the issue, it’s probably easier to see in movement.

shadow

And here is the collision mask.

I can tell it’s interacting with the collision mask, which is fine, but don’t want any of the light to be seen through the tree, I want all the light to stay behind the tree. I hope this helps make more sense!

OK, I see the issue now. :blush:
I guess you forgot something somewhere, hard to say what/where, especially since I’m not a lights expert.
It sounds like you’re in for a game of “spot the differences”.

Did you make sure that the layers existing in level 2 also exist in level 1? That’s a common mistake, I believe.
Also, if one object exists in several scenes and you convert it to global, it could create conflicts/issues. :thinking:

Have you tried deleting the involved objects and re-adding them? In case some weird bug slipped in. :person_shrugging:

I believe i can help you, but please can you put the light, tree and character events?
(If the light problem still in your game)

I think I might just delete the global object and recreate a new one (with a slightly altered name so the game does not confuse the two, just to be real paranoid)

@Gruk, after what you said, I think that’s exactly what happened. In Level 2 I turned it into a global object, while the object was already in level 1 as a non global object. I’m suspecting it’s a weird bug related to that, so I’m going to try that.

@ElementerTheDragon Thank you so much for offering the help! I’ll try what Gruk suggested first, I suspect more than anything it’s a bug in the game and not a result of any programming mishap on my side. After a few years of tinkering with GDevelop I have a pretty good sense of it by now, so being blindsided by this issue makes me think it’s a bug.

understood! See you in another post!

OKAY FINAL UPDATE I FIGURED IT OUT

Well not completely but I did make it stop.

I had a ‘lighting’ layer on top of the base layer where all the objects are on. For some reason in level 1, I activated the light to follow the player, and it was not activated in level 2.

There was also programming within the levels themselves that had the light follow the player, so. I am baffled why I had it in twice and why it seemed to start messing things up now!!

Anyway, looks like that was the problem! Thank you guys so much for trying to help, I spent way too many hours pondering this lol

1 Like