Search Unity

Can you enlighten me a bit about the Workflow for very simple 2D Sprite Animations?

Discussion in 'Animation' started by Brainshack, Sep 3, 2014.

  1. Brainshack

    Brainshack

    Joined:
    Mar 1, 2013
    Posts:
    33
    Hi,

    so yesterday i tried to set up something, that I though should be very simple to do. All I wanted to do, is to spawn a 4 Frame sprite Animations, that plays one single time and then gets destroyed. Think maybe something like an explosion of sorts.

    What I wanted to do:

    - Create a new Animation Asset (by right clicking in the project explorer)
    - Drop my four images into it
    - Make it appear somewhere in my script

    However, this basically failed at the first step. I was able to create the animation asset, but there was no way for me to edit it in the animation window.

    What I ended up doing was:
    - Drop the first sprite in to the Scene View, so that a GameObject with a sprite renderer was created
    - Then I was able (while having the GameObject selected) to add frames to my animation
    - Then I had to create a prefab of that gameobject, that I then would have to assign to my script to be able to spawn it
    - Then I had to add an animation event, to be able to call a function that would destroy the spawned GameObject, once the animation has been completet
    - It also had to create an animation controller, even though in theory, I didnt really need the features of that componenent, since I really just wanted to make a one shot animation

    Now this workflow seems a very bit long and uncomfortable in many ways, when it comes to just creating simple, one shot sprite animations. Especially when you want to have a whole lot of animations that you can choose from. Having to create prefabs out of all of them and assign them all to a script that can choose from me, seems to be a very unooptimal way to doing things. Especially when you consider what I actually just wanted to do. (Imho, the workflow should be like I intstinctivly thought it should be in first place, since it just make sens.) For example, why can I create an animation when I am not able to edit it in any place anyway? This is very confusing about the animation system.

    Or maybe, I am just doint something essentially wrong? I googled for the problem, but wasnt really able to find something that seems to be a more reasonable approach.

    Maybe you guys and gals can enlighten me?

    Thank you very much,

    Cheers