Hello Guest

Author Topic: Missing mesh filter in tile map  (Read 3364 times)

yannrujcheng

  • Newbie
  • *
  • Posts: 2
    • View Profile
Missing mesh filter in tile map
« on: March 11, 2014, 04:51:44 pm »
I am using tk2d tile map to build a runner game. Each level component is a tile map and we stitch multiple tilemaps together to create the endless runner effect.
After I update to 2.3.3 I am running into the problem where if you destroy a tilemap (ex. forest_1) during the game it also removes the mesh filter of other forest_1 tilemaps that are still in the game.
Does the tilemaps share the same mesh filter? Is there a way to fix this problem?

thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Missing mesh filter in tile map
« Reply #1 on: March 12, 2014, 11:34:25 am »
The tile map destroys its own mesh data, and it isn't shared. Prior to 2.3.3 the render data wasn't destroyed when the tile map was destroyed.
How are you stitching the tile maps together? How are you loading them into the scene?

yannrujcheng

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Missing mesh filter in tile map
« Reply #2 on: March 12, 2014, 03:46:20 pm »
ohh I see thanks!

Forest1
  anchor min
  anchor max
  tile map
  tile map render data

anchor min and max are used to stitch the components together. There is a pool of level components in the game that is not visible. Whenever the game needs a component it will choose a random component from the pool and instantiate that component. If the mesh data isn't share then shouldn't destroying Forest1 not affect the other Forest1 that are still active in the game?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Missing mesh filter in tile map
« Reply #3 on: March 12, 2014, 09:34:49 pm »
If you want to do this, I recommend instantiating a prefab that isn't in the scene. That way it won't already have a render data reference in there.

In any case, it really isn't recommended to instantiate tile maps like this especially not for a runner game - instantiating a tile map section will take a fair bit of time and your game will likely stutter. You're probably not seeing that now as it isn't actually generating the data as it thinks it already has render data - the render data which of course belongs to the thing you're instantiating from.