Hello Guest

Author Topic: [Solved] Disappearing tilemap when "Commit"ed  (Read 5967 times)

brianjenkins94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
[Solved] Disappearing tilemap when "Commit"ed
« on: June 13, 2013, 05:45:07 pm »
Hi there,

I just started to use Unity/2D Toolkit, but I seem to be catching on quickly through trial and error. I've managed to set up a tilemap with 32bit tiles of grass above a plane of equal size of the screen. While it was one hell of a struggle and I still do not understand the reasoning behind why some of the values I had to insert created the desired spite plot, I have successfully laid it out the way I originally intended. This being so, as soon as I hit "Commit" on the tilemap, all of the content I laid out disappears so that it is completely invisible to the camera view and in the editor. If I do not select commit, everything is visible (including a grid that I would also like to get rid of).

Some additional information:

 - I'm working with only one layer: Layer 0.
 - I've set up a TileMap, TileMap Render Data, Main Camera, and a Backdrop Plane object.
 - Tile Properties: Position: 0, 0, 2; Origin: 0, 0, 2; Size: 32, 32, 1. With the Dimensions at: Width: 40; Height:25; PartitionSizeX: 32; PartitionSizeY: 32.

 - Latest Version of Unity
 - Latest Version of tk2d

Any help would be greatly appreciated.
« Last Edit: June 13, 2013, 07:20:24 pm by brianjenkins94 »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Disappearing tilemap when "Commit"ed
« Reply #1 on: June 13, 2013, 06:47:39 pm »
Hi,
Have youset up prefabs for these tiles in the Data tab of the tilemap editor?

brianjenkins94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Disappearing tilemap when "Commit"ed
« Reply #2 on: June 13, 2013, 06:58:17 pm »
To the best of my knowledge, I have.

I tried setting it to the original png and the sprite collection containing the sprite but neither seemed to have alleviated the issue.

Here's a pic:

brianjenkins94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Disappearing tilemap when "Commit"ed
« Reply #3 on: June 13, 2013, 06:59:37 pm »
I retract that statement, setting the prefab to none seems to have solved the issue of the sprite's disappearance.

Do you think I could trouble you to explain why that would have fixed it? Or more embarrassingly, what exactly a prefab is?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Disappearing tilemap when "Commit"ed
« Reply #4 on: June 13, 2013, 07:15:27 pm »
A tilemap normally gets optimized down to some really efficient meshes. This means that once the tilemap is built (committed, or when the game is running) you will not actually have gameobjects there, but rather this flattened mesh. If you wanted to paint in start positions, end positions, etc, you'd attach something to the prefab slot, so when building the tilemap, it will replace that tile with whatever your prefab contains. Think of painting enemy spawn positions in a sidescroller - when the game is built, you'd want them to be replaced with the actual enemies themselves.

That is what the prefab system is for. And, you probably set it to an empty prefab, and all that'll do is replace that tile with an empty prefab, hence the tilemap going invisible when committed. If you'd dropped in a prefab containing the sprite, it would've been visible. Not efficient, but it would have actually been visible.

brianjenkins94

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Disappearing tilemap when "Commit"ed
« Reply #5 on: June 13, 2013, 07:18:53 pm »
Excellent, thank you. That was some incredible customer support. I will mark this thread as solved.