Hello Guest

Author Topic: Tilemap Sprite Collection "has no sprites"  (Read 4280 times)

mark

  • Newbie
  • *
  • Posts: 7
    • View Profile
Tilemap Sprite Collection "has no sprites"
« on: April 09, 2014, 02:31:13 am »
I'm trying to create a new tilemap.  I've followed the following tutorials:

http://www.unikronsoftware.com/2dtoolkit/docs/latest/tilemap/tutorial.html
https://www.youtube.com/watch?v=jI3jVnXTiIg

I create the sprite collection, add the sprite sheets, set the config values, apply, commit, and everything seems good.  The problem is when I create the tilemap.  When I try to change the sprite collection value in the dropdown in the tilemap settings, I get the message:

Error
Sprite collection 'spritecollectionnamehere' has no sprites

As far as I can tell, it does though.  Any ideas?  I've exhausted mine.

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Sprite Collection "has no sprites"
« Reply #1 on: April 09, 2014, 05:55:59 am »
You can verify if its working properly by creating a normal sprite and setting it to use that sprite collection.
Otherwise post the project here and I'll take a look, this should just work unless something has gone wrong?

mark

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap Sprite Collection "has no sprites"
« Reply #2 on: April 09, 2014, 03:37:53 pm »
Thanks for getting back to me.  Here is a link to the zipped archive:  [Removed Link]

I'll leave it available until you post again.  I apologize, the project is a bit of a mess at the moment, I'm playing around with stuff.

I removed the main camera and added a tk2d camera, and since I did that I can't even get a sprite collection that I create to show up in the tilemap dropdown, much less work with the tilemap.

The scene I'm playing around with is Level1_Foo2.  The current sprite collection I am trying is IcePlatformerSpriteCollection, at the top level of the assets.

Thank you.
« Last Edit: April 09, 2014, 07:03:56 pm by unikronsoftware »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Sprite Collection "has no sprites"
« Reply #3 on: April 09, 2014, 07:14:12 pm »
Your sprite collection doesn't seem to be valid, and neither does it seem to be in the index.
1. Select "IcePlatformerSpriteCollection" and open editor.
2. Commit
3. Create new tile map, create new data / editor data objects. select IcePlatformerSpriteCollection from drop down (should be visible now, if not try 2D Toollkit > rebuild index).

mark

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap Sprite Collection "has no sprites"
« Reply #4 on: April 09, 2014, 08:33:06 pm »
Thanks.  I had no luck recreating and reindexing everything, so I created a fresh project to try it there.  It worked there, so I copied the prefab and data folder for the sprite collection to the existing project.  That at least got the sprite collection showing up in the dropdown again.  However, no images were showing up in the palette of the tilemap, and the tilemap editor buttons in the scene design were not there.

I completely re-imported the 2D Toolkit asset for the existing project (Asset -> Import Package -> Custom Package (and select the download location of the asset) and things seem to be working as expected now.

Thanks for your time.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Sprite Collection "has no sprites"
« Reply #5 on: April 10, 2014, 02:45:19 am »
If you aren't already aware you shouldn't copy assets between projects - you're very likely to end up with broken assets. Always use export unity package and import on the other project.