Hi, did you guys encounter the problem that when updating new sprite sheet, the previous sprite animations, sprite renderer will mess up?
Any idea about how to solve this issue?
I’m using Unity Free version.
Hi, did you guys encounter the problem that when updating new sprite sheet, the previous sprite animations, sprite renderer will mess up?
Any idea about how to solve this issue?
I’m using Unity Free version.
What do you mean by “updating” the sprite sheet? Replacing it? And what do you mean by “mess up”?
If you provide more details, like what exactly you are doing, and what exactly is happening, it will be easier to help you out.
Thanks for reminding
I use TexturePacker to pack my sprites into one sprite sheet, and I create GameObjects with these sprites.
Later I add more sprites into the sprite sheet, while keeping the name of the previous sprites the same.
However, some previously created GameObject’s sprite is changed to other sprite strangely.
Are you using something to translate/read the sprite sheet info that TP outputs? Or are you just creating the regions by hand in Unity? If you are creating them by hand in Unity, that would explain your problem. As you add sprites to the sheet in TP the locations will change.
Actually I use https://github.com/f15gdsy/TexturePackerImporter as a parser to read the data file output by TP.
So you mean Sprite Render recognizes the sprite based on the location but not name ?
Yea, once assembled, Unity (or anything for that matter), doesn’t know anything about the “parts”. The locations either come from Unity or TP and are what the sprites understand. Presumably with that tool, you would just need to parse the file output from TP again. If it uses the names from the TP file, in theory things should line up correctly.
Thanks man, you are correct
I just found out that the importer used hash table for looping through the frames, which creates the uncertainty of the sequence.
After I added a sorting function for