Hello Guest

Author Topic: Tilemap changes when in play mode (and generally doing weird things)  (Read 4377 times)

tomplayniac

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Hey! We've been using the tilemap fairly happily for a game we're working on, but we've noticed that getting our artist to add things to the sprite collection tends to do weird things when we push it through git. Either way, this time it seems to have totally bricked the levels we have that use that spritecollection.

We've got four different issues that seem to occur (they all seem to be linked by the sprite collection/collection data prefab) -

Firstly, the updated sprite collection creates a new atlas, which totally ruins the levels - this can mostly be avoided if the programmer (me!) adds things to the sprite collection (for reasons unknown - likely a source control thing, although I can't imagine how).

Second, we've noticed that our source control seems to create duplicates of the data prefab for our sprite collection, and there doesn't seem to be any way to find out which one of these the sprite collection is actually linked to.

Third, we've had some tilemaps which, upon clicking the "edit" button, bring up the "Scanning project folder..." loader. On completing, it just resets, sticking it in a very annoying loop that we've not yet found a way out of, save for force-quitting Unity. A message displaying "Unable to find sprite collection. This is a serious problem." shows in red in the console.

Lastly, on removing and rebuilding those levels, we've noticed they change their appearance after hitting play, adding the new tile in weird places, which we figure is an atlas issue. Especially weird, seeing as that asset no longer exists in the atlas.

I've been wrestling with this over out 40 odd levels for about 2 hours now - I'm going to keep tinkering, hopefully it'll sort itself. I'll post updates as I go along.

tomplayniac

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Tilemap changes when in play mode (and generally doing weird things)
« Reply #1 on: November 12, 2014, 08:15:02 pm »
Alright, apparently all fixed. I deleted the data for the sprite collection, rebuilt it, then reset every instance of the sprite collection in the game. The play mode bug persisted on a few levels, but deleting and rebuilding the render data seemed to help.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap changes when in play mode (and generally doing weird things)
« Reply #2 on: November 12, 2014, 08:36:10 pm »
Hmm that sounds very much like your sprite collection data was corrupted somehow. Just checking that you've been checking in your meta files correctly and there hasn't been any case of the data getting corrupted? If you're using text version control you should be able to peek into the prefab contents to see what is going on and when it actually broke, and possibly work out why