Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Pink tiles after simply re-opening my project???

Discussion in '2D' started by DaniKroes, Oct 17, 2022.

  1. DaniKroes

    DaniKroes

    Joined:
    Jul 26, 2021
    Posts:
    12
    I have been hesitant with using the tilemap system provided by Unity in the past, since it would create pink tiles and shift around the tile palette tiles each time I would update my spritesheet...

    Now today... I have finally found the courage to give tilemaps another go, and figure out how to properly update a spritesheet used with Unitys tilemap system.

    Everything went perfect, and I learned how to properly update spritesheets without the palette breaking... Until this happened...

    I went from this scene...
    310733504_1235931797252934_7300555389335719210_n.png

    To this scene...
    23.jpg

    And all I did to make this happen, was to close Unity, and later re-open my project back up again... o_O

    I didn't update my spritesheet. I didn't touch anything inside Unitys tilemap or tile palette... I simply re-opened my project... And now I am in a awkward situation, because Unitys tilemap system feels INCREDIBLY unstable and I am scared to risk loosing progress had this been a "serious" project I was working on.

    So if anyone can't provide an answer to what might cause this issue, I would be very grateful. :) It is ONLY my Scene view that has pink tiles. My tile palette is completely normal and has no pink tiles.

    Just to explain how I went about things, in case I did do something to cause this earlier in the process...

    Whenever I updated my spritesheet, I would open it back up in the Sprite Editor, and then re-slice the sheet by selecting "Smart" as the method. I would then re-drag the sheet into the tile palette in the exact same place as previous, save it in the same location when the pop-up appears, and select "Overwrite" (I did also try Reuse, but it did nothing).

    Also, every time I re-open the project, it BRIEFLY shows all tiles being correctly placed in the Scene view, until going back to pink tiles... So it clearly knows the tile references for a brief moment, until messing it all up again...?

    When opening a single tile from the Scene in the Inspector, I can see that it's simply "missing" the tile reference... But how can it do that when everything worked perfectly, until re-opening the project?
    2.jpg
     

    Attached Files:

    Last edited: Oct 17, 2022
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,965
    I think this is the start of your problems. I would not use stuff like Smart Slice. Who knows how "Smart" that is? Instead, simply chop each of your source textures into a preset number of correctly-sized tiles (slice by grid), and then replace unused cells with new tiles as you add them.

    Alternately, make one image per tile, or group of tiles, and use Unity's sprite packing.

    Tilemap and Unity are fine, we use them in production systems. Something about the WAY you are using it (see above) is reordering or renaming internal linkages.

    Whatever it is, you should ALWAYS be working with source control so you can instantly revert when you have an issue.
     
    DaniKroes likes this.
  3. DaniKroes

    DaniKroes

    Joined:
    Jul 26, 2021
    Posts:
    12
    You are probably right about the "Smart" method not being "smart" hehe. I'll avoid using it.

    Just so I understand you correctly... Are you recommending to separate the sprites into separate files, and then dragging them one at a time into the palette?

    So far, I have created large spritesheets like my image bellow, and then "reserved" empty spaces for future additions to that spritesheet. Since you can't resize your document without... again... the palette getting all "screwie".

    fds.jpg

    ANY content online that I have been able to find, says to do it in the way that I have been doing it (minus the Smart method). But still then at some point after updating palettes they will turn pink. It just seems like such a simple thing, causing so many issues even when done like everyone online tells you how to. :/

    I have noticed that it is ONLY tiles that I have "replaced" by re-dragging the spritesheet back into the palette, that are randomly turning pink as time goes. You know when it asks you "Overwrite?" and gives you the option of "Overwrite, Reuse, Create New Copy"...

    So I have narrowed down my specific issue to being somewhere around that step. :)

    I don't know what part of that step is causing it to get confused though, or why the pink tiles only happens later on randomly, without me touching anything...
     
    Last edited: Oct 17, 2022
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,965
    This is another thing that source control gets you: you can see the diffs generated in the .meta file when you adjust your sprites, and hence begin to reason about the connections that get you from texture to sprite to tile. It's not magic, it's just a lot of different identifiers of various types.
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,965
    That's the key: if you want to do it by keeping one sprite sheet and adding new sprites yourself, then really the ONLY thing you can do in the Sprite Editor is add more new sprites. You will likely see that doing so is quite stable, as you track it over time via source control.