I have a question: how can I create a animation wich uses only a single sprite? I know the way of dragging multiple sprites from the project view into the hierarchy to create 2D animations, but if I do that with a single sprite, It does not work.
How can I get an animation based in just one sprite?
You could add an Animator component to your sprite game object. After that, you can make use of the Animator and Animation window to create your animations.
I’m here from Google, and I figured it out after a bit of fiddling:
If you haven’t already, select the sprite and select Multiple in the Sprite Mode, and then go to the Sprite Editor and Slice the sprite into multiple subsprites. After that, your sprite will have a small arrow on it in the Project window. Click that arrow to see all the subsprites. Select all those and then drag and drop them into the Hierarchy, just like you would if you had multiple single sprites. The rest is history
The real question is how to do a single frame animation… For example, for death animation, you don’t want any movement, you just want animation controller to switch to correct pose.
It’s a bit of a pain to create these 1 frame anims, so far I’ve only managed to create 2 frame animations, and then remove 1 of the frames, not sure if there are better options.
P.S. To anyone wondering, you can create these, just select the sprite and right click on it, then select Create → Animation:
When you say animation you mean making the graphics change? Are you using a sprite sheet that you want to divide up in to animations, then cycle through the sheet? if so go the the image and in the import inspector select Sprite Editor and slice the image up.
This is an animation i made of a lava spring: