Hello Guest

Author Topic: Tilemap tiles disappearing when dynamically spawning committed tilemap  (Read 3619 times)

fkosie

  • Newbie
  • *
  • Posts: 3
    • View Profile
We are running TK2D 2.5 in Unity 4.6 on windows.  For our game we are spawning and pooling all elements, including prefabs for tilemaps.  Part of our use case is the ability to dynamically generate the level.  The issue we are running into is that:
* If a tilemap is uncommitted, it can be spawned and all tiles will appear, however this is not preferable.
* If a tilemap is committed, we can use 2D colliders and other features, etc, but tiles become invisible.
* This problem does not happen if we do not dynamically spawn tilemaps and simply load them as part of the scene.

Please let us know if you are able to fix this, otherwise any advice on how to work around it would be appreciated.

Thank you.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap tiles disappearing when dynamically spawning committed tilemap
« Reply #1 on: December 22, 2014, 10:54:09 am »
What are you spawning - is it the tilemap object in isolation or the tilemap + data objects? Do you have prefabs on each tile? How are you loading these / how are you referencing them

fkosie

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Tilemap tiles disappearing when dynamically spawning committed tilemap
« Reply #2 on: December 23, 2014, 04:23:22 am »
We are spawning the tilemap with nested data object such as "PrefabLevel1TileMap1 Render Data".

There are no prefabs on each tile, when selecting the Data tab and highlighting tiles, Prefab is set to "None".

We load the prefabs for the tilemaps using Resources.LoadAll() and instantiate them using GameObject.Instantiate().

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap tiles disappearing when dynamically spawning committed tilemap
« Reply #3 on: December 23, 2014, 10:45:04 am »
Don't have the data object nested, lots of things break if you do that. You don't need that to instantiate a tilemap.

fkosie

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Tilemap tiles disappearing when dynamically spawning committed tilemap
« Reply #4 on: December 31, 2014, 03:57:41 am »
Thank you, that fixed it for us.