- Home /
2d sprite animation issue
Hi, I am just wondering where I might be going wrong setting up 2d animations. I am not an artist but I think the sprite sheet I have created is set up the correct way, at least it looks like it is set the same way I have seen in references.
However when I create the animation my sprite seems to twitch as if the pivots are off centre. I know I can change the pivots and I know how, but I am wondering why Unity does not just pick up the correct points like other sprite sheets I have tested. for instance the Braid sprite sheet here Braid has many different widths and heights for the run animation, but with no changes in unity it works perfectly with zero twitching.
I have attached my sprite sheet here to see if any of the more arty people can see where I am going wrong.
I'd really appreciate some help so I can create future sprite sheets correctly opposed to spending hours twiddling with pivot points for each individual sprite.
And just so people know my approach with both my sprite sheet and the braid one. I am using unity 5, selecting frame 0 - x (x being the last relevant frame), dragging them into unity scene (creating an automatic animation). This is done using a Sprite 2d, multi, auto slice.
Any help as I said is really appreciated as this is driving me insane.
Answer by anyname1 · Oct 30, 2015 at 01:24 PM
Set the file size in your art tool to be a multiple of 32 x32, 64 x 64 etc. depending on the max size each individual sprite will take up. after checking all of the sprites animate correctly in your art tool you will need to make sure each sprite is moved to a certain distance of each other.
I accomplish this using Photoshop, creating a layer with a coloured square, in the example below that is 64 x 64 on a 512 x 512 image. Then simply move each sprite exactly into the adjacent square with the coloured layer behind making sure it lines up exactly.
Finally when you have all of your sprites separate again, import into Unity and slice by grid size, using the division size you used in the art tool, in my instance again that is 64 x 64.
Answer by tarasfromlviv · Oct 30, 2015 at 09:08 AM
This is because it trims out each image (alpha) and the end up with slightly different width and height. For this case I would suggest laying them as a perect grid and then use grid in Unity sprite editor.