[Solved] Object not visible

The mystery of the object that isn’t (Except for when it is)

Hi there!

I’m working on a group project at uni.
This is our first time ever using gdevelop and our project is wildly ambitious since we’re all technically year 0 (Like, the introduction for people with very little experience to prepare them for actual university)

Anyway, we have this bug with objects not being visible when put on a layer above a lighting layer. I wish I could show more here but I’m basically managing the art side of the project and I’ve had very little input on the code.
I apologise for this image, originally I had them all seperate but being new to the forums I can only have 1!
(I’m an artist, I swear)

  1. This is the room. For this example I’m looking at the hint in the bottom right. The one the arrow (player) is facing:
  2. Here are the object properties
  3. Layers
  4. In game (Lack of object)
  5. The debugger insisting that the object is visible
  6. The hint object when moved to the base layer
  7. All mentions of the word ‘Hint’ in the code through ctrl-f
    I deleted any reference to hint1 so it was completely unaffected by anything just to play with it.

I would super appreciate any ideas for what is wrong here. As i said before, I’ve just been doing the art up to this point and though I kind of understand the code I didn’t write any of it.


Hey! On the picture no.2 it’s says its on the base layer, there might be your problem. Otherwise I’m out of ideas.

Maybe it’s just not a great idea to use a slash character in a layer name…

Oop, that was a mistake when i retook the screenshots. Good spot though!

Good point. I’ll mention that to my group.
Taking out the / didn’t fix it though sadly.

The debugger shows the object is visible, but is the Hint layer itself visible? What does the debugger indicate?

1 Like

I thought you might be onto something because I hadn’t thought to check layers
Looks like it should be there though.

Are there any error messages when you press ctrl + shift + i?

Sooooo, there are 11 warnings

All 11 errors are indentical and from missing sprites, I’m actaully the likely cause of this since I often add and remove them when I’m working on the art side of things.

Nothing in here about layers and the hints.

No need for that, errors trigger all sorts of wild unexpected results.
Warnings (in yellow) are not a problem, though.
Go to the resources tab and right-click in the list to remove invalid resources, if any.

Regarding the slash, GDevelop is supposed to have protection against that, but well, flaws happen, and I wonder if it could have somewhat corrupted your game file. :confused:
It’s typically the sort of characters that hackers use to break things.
Also, things as simple as forgetting to wrap a string with quotes, or adding quotes where they’re not needed, can break a game. So check the events sheet carefully. Again, it doesn’t have to be directly related to the bug you’re experiencing.

Anyway, more troubleshooting steps if you like:

  • Move the hints layer below lighting to confirm that objects display.
  • Create a new layer above lighting, add an object and check.
  • Delete the lighting layer and recreate it.
  • Duplicate the scene and delete events and objects until you find some culprit.

Also, check in the objects groups if there’s a group for these objects, there could be an action applied to the group that you missed.
On a side note, I tried to recreate your issue in the lighting example, with a layer above lighting and a slash in the name, but nope.

Thank you for all the advice!
So I fixed all the errors and even the warnings just to be sure.
Took out that slash
Made a backup and removed almost the entire game, keeping only this scene, cleared out all the code from the scene. Still no luck!
I tried putting the hints layer under the lighting layer, nothing, I guess that rules out the lighting as the culprit. I then tried putting it on the lighting layer and it does appear but still affected by lighting.
I tried making a new layer but that doesn’t show up either. It seems like anything not on the base layer or lighting layer doesn’t appear!
I don’t suppose you have any more ideas?

Can you share this stripped project?
If so, do File/Save as to a new folder, it should save the json and used assets only. Zip the folder and upload on easyupload.io for instance.


Here you go!
Thank you so much for looking into this. I really appreciate the help!

99MB seems very big. Are you sure this is the stripped version?

I suppose I could have stripped it further…
I guess I was thinking in terms of scenes of which there were a lot more.
It’s probably art assets for the overworld. I can remove more!

I downloaded the game and checked out your issue. The problem is that the camera for the base layer is moved, but that position change isn’t applied to the cameras on the other layers :


1 Like

My hero!
But how do I fix it?
I don’t know how to move the camera of a specific layer

There is a “Center camera on player(layer: , camera:)” action at the beginning of the scene. Add more of those, one for each layer, and as you add them there will be a list of parameters you can set, the second to last being layer.

Don’t worry about the camera number as the default is the main camera.

1 Like

That did it!
Oh my god, thank you so much!