1
\$\begingroup\$

I am developing a game in Unity3D. I have a bunch of images which display the character animations. I decided to use texture packer to reduce the amount of individual images. I create one sprite sheet with type multiple containing all the images of my animation.

After creating the sprite sheet the animation broke up. The images start to overlap and not animate in the same speed despite the fact that before the animation was working fine but heavy on my app.

The spritesheet was created by importing all my assets for every animation into texture packer and export it into png file with a dimension of: 4096x4096

\$\endgroup\$
  • \$\begingroup\$ does anyone care to explain why the down vote ? \$\endgroup\$ – Sora Mar 9 '15 at 10:39
  • \$\begingroup\$ You have made an intro, but you did not explain the exact problem. "the animation start to have a weird behavior and does not animate correctly" is too broad to even try to answer. P.S. I'm not the downvoter. \$\endgroup\$ – Kromster Mar 9 '15 at 10:57
  • \$\begingroup\$ ok i understand ,i'll edit my question :) \$\endgroup\$ – Sora Mar 9 '15 at 11:04
  • \$\begingroup\$ please check my edit \$\endgroup\$ – Sora Mar 9 '15 at 11:09
  • 1
    \$\begingroup\$ Probably the problem is with the sequence of texture the TexturePacker outputted to sprite-sheet also check that dimensions of all sprite are same as before. \$\endgroup\$ – 2600th Mar 9 '15 at 12:35
1
\$\begingroup\$

Unity needs some way of "finding" the animation frames in the sprite sheet. What you currently see is that this information is not property provided.

There are several ways to set this up. The easiest way is to use TexturePacker Importer. It reads a data file provided by TexturePacker and slices the sprite sheets. Here's a micro tutorial.

Another way would be to create all frames with identical sizes and tell Unity how big they are. Or use some 3rd party framework like 2dtoolkit ...

So which way are you using to import the data?

Btw. 4096x4096 might give you trouble on several platforms. While this might not be your current problem it has a good change to result in jittering animations due to limitations in floating point precision in OpenGL. I would really recommend using 2048 or smaller sprite sheets.

\$\endgroup\$
  • \$\begingroup\$ my sprites are big like 500x600px each and for one animation i have like 100 sprites , so i want to fit all those sprite in one image for not to lost the frame sequence , but thank you for your answer i guess this is what i was looking for , a proper way to align the sprites in one spritesheet \$\endgroup\$ – Sora Mar 10 '15 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.