Hello Guest

Author Topic: Render tilemap tiles with prefabs attached?  (Read 4011 times)

Prodigga

  • Newbie
  • *
  • Posts: 3
    • View Profile
Render tilemap tiles with prefabs attached?
« on: February 18, 2014, 04:04:59 pm »
Hello, is turns out if you attach a prefab to a tile it wont render any more. All I need to do is spawn a box collider on certain tiles. I need a box collider because I am using a tool to generate a navmesh for the level and the tool needs to collect the colliders and build the navmesh.

So is there any way to enable both at the same time? This is really bugging me as the the tile editor was the primary reason for buying this.  :(
« Last Edit: February 18, 2014, 04:06:46 pm by Prodigga »

Prodigga

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Render tilemap tiles with prefabs attached?
« Reply #1 on: February 18, 2014, 04:28:26 pm »
My work around now is to have 2 tile sets. one with the levels 'visual tileset' and another one that places the prefabs over the tiles. (like a "data" tileset). Ah well, I hope in the future we can have tiles that have prefabs but can still render as tiles. Would be nice and I can't imagine any real restrictions stopping you guys from allowing it! :D

everything else is great with the framework, thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Render tilemap tiles with prefabs attached?
« Reply #2 on: February 19, 2014, 10:34:16 am »
Hi. The prefabs are meant to be replacements for tiles - it does make sense what you want, but adding that as a general feature will open up doors to unending amounts of confusion - eg. add a character prefab, and he moves but leaves behind another character tile, etc. Its easy enough to patch in though - but what you're wanting seems to be a temp thing to create these box colliders to build the navmesh?

tk2dTileMapMeshBuilder.cs -
bool skipPrefabs = editMode?false:true;
set it to false, and the render part of the prefabs will always be built.

Prodigga

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Render tilemap tiles with prefabs attached?
« Reply #3 on: February 27, 2014, 12:36:23 pm »
You make some excellent points about the prefabs. I agree, it would be confusing and it is only useful in some edge cases like this. The patch is nice, thanks! Though I will stick to my workaround because it is much less confusing (as you've pointed out).