Hello Guest

Author Topic: Tilemap: exceptions thrown if no colliders in tilemap  (Read 3800 times)

ccampama

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Tilemap: exceptions thrown if no colliders in tilemap
« on: October 13, 2013, 07:55:42 pm »
Hi!

We have just created a second tilemap in our scene with the idea to simulate a parallax scroll as the background of the main tilemap. This background tilemap is currently using only one tile (repeated many times) that has "force none" as the collider. But when we run the project, we get two exceptions like this one:
"
NullReferenceException: Object reference not set to an instance of an object
tk2dRuntime.TileMap.ColliderBuilder.Build (.tk2dTileMap tileMap, Boolean forceBuild) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapColliderBuilder.cs:38)
tk2dTileMap.Build (BuildFlags buildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:282)
tk2dTileMap.EndEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:486)
tk2dTileMap.Awake () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:121)
"
 Are we doing something wrong, or is it a little bug? When we set a collider for the tile, then everything is fine, but we don't want it to have any collider.

 Thank you in advance!
« Last Edit: October 13, 2013, 08:31:07 pm by ccampama »

ccampama

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Tilemap: exceptions thrown if no colliders in tilemap
« Reply #1 on: October 13, 2013, 08:30:01 pm »
Doing some more tests, it could seem to happen when we use a diced tile that is bigger than the tile size of the tilemap (tile size is 64x64 and the tile used for the first test was 1024x512). Now we have replaced the big tile for the final ones (that are all 64x64) and the exceptions seem to have dissappeared.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap: exceptions thrown if no colliders in tilemap
« Reply #2 on: October 13, 2013, 10:39:32 pm »
Thanks for reporting this.
I'll investigate it.

One thing though - its probably not a good idea to use heavily diced images as tiles - the poly count can potentially increase to unmanageable levels.