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).
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.
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.
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
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.
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.