Tilemap not displaying in-game (SOLVED)

Up until now I was building a map with several game objects with sprites, and decided to expand the map by replacing the existing stuff with a tilemap. I can see it showing in the editor, but when starting the game it doesn’t appear, nor do its collisions work (if it just happened to be invisible).

I’ve tried the potential solutions in Can't make tilemap show in-game (SOLVED)

  • Checked Z index for the game object, the tilemap, the layer - it’s set to 0 which is the same as all the existing map components so far
  • Tried both tile_map.material and sprite.material for the tilemap material

In addition, there’s no error logs showing up, and from some debug logs it’s able to successfully resolve the position of the thing - I just can’t see it. The rest of the map appears fine and the game runs perfectly fine - just the absence of the game object with the tilemap.

Some screens:

Where is level.collection placed in main.collection?

Outline for main.collection:

I’ve also tried moving the tilemap game object out into main.collection instead of nested in level.collection but same result.

I would try to put the tilemap in a game object in a new collection and set that as bootstrap collection. Ensure a z-value if 0 on the game object. What’s the depth of the layers? Are you using a custom render script?

As part of some other work to support pausing I changed my bootstrap collection to one with a collection proxy - tried moving the game object for the tilemap in there and it doesn’t appear then, but if I put it in a new collection, by itself, and set that collection with only this one game object as the bootstrap collection - it appears… weird. From everything I’ve looked at, the Z layer is 0 - the game object, the tilemap itself, the layer in the tilemap. Also, I’m not using a custom render script.

Is your tile map in a collection proxy? If it is it could be as simple as it is not loading properly take a look here if you are doing it the same way. First send a message to load it and also receive the message in your on_message again to enable it.

It is now (wasn’t at the time of creating this post). The rest of the stuff is also in there as well though and it loads correctly every time.

You’re best bet now if it still isn’t working is to share the project so I can take a look (Bjorn.ritzl@king.com)

Done!

What’s the name of the project? The list of projects in my dashboard is huuuuuge.

Ah, apologies - the name isn’t very unique (My runner) - link is here: https://www.defold.com/dashboard/projects/90527

There’s a bunch of errors in the console when I run the project:

DEBUG:SCRIPT: vmath.vector3(20, 32, 0)
DEBUG:SCRIPT: vmath.vector3(0, 0, 0)
DEBUG:SCRIPT: vmath.vector3(200, 100, 0)
DEBUG:SCRIPT: vmath.vector3(210, 36, 1)
ERROR:GAMESYS: Default animation 'Level_Tree' not found
WARNING:RESOURCE: Unable to create resource: build/default/_generated_b1b358f6.spritec
WARNING:RESOURCE: Unable to create resource: build/default/_generated_5ac70ed3.goc
ERROR:GAMEOBJECT: Could not instantiate game object from prototype /_generated_5ac70ed3.goc.
ERROR:GAMEOBJECT: Child not found: /camera
WARNING:RESOURCE: Unable to create resource: build/default/level/level.collectionc
ERROR:GAMESYS: The collection /level/level.collectionc could not be loaded.

That’s kinda important information :slight_smile:

The problem is not very obvious, but it’s a known issue. The thing is that you have both a level.atlas and a level.tilesource. Both of these files will generate a level.texturec file when building the project and one will overwrite the other. You need to rename/move one of the files in order to solve the problem.

5 Likes

oh… man. I get this occasionally but I restart the editor and it goes away usually - I was going to attempt to handle it further down the line when I was more familiar with everything but didn’t figure it was related to this issue - I’ll try fiddling about with this stuff then and see if it resolves the issue. Much thanks!

edit: Appears now after renaming - always the simple things.

4 Likes