- Home /
Having trouble changing sprites in 2 dimensional animation
I am trying to create an animation which will change the sprite every so often, the way i am doing this is by adding a sprite curve under the sprite renderer in my animation. It looks like this: Now this doesn't seem to work, and acts quite strangely. First off immediately after doing this and then previewing it in tha animation it will only use the sprite that has most recently been set, regardless of the timeline. Secondly it will revert the sprite to the normal image whenever I play the scene, save the scene, or select another gameobject among an array of other weird actions. As a result the sprite always seems to revert. It seems like I am doing this completely wrong, so can someone please help me. This is a 2d project.
Answer by eightbitstev · Mar 21, 2014 at 05:05 AM
Are you using an AnimatorController anywhere? Usually you would use an Animator on your character and have it reference an AnimatorController which would control the animations you make. Other than that, I can't tell what the problem could be, but I'd suggest looking at http://learnunity2d.com/2d-character-controllers-tutorial/ for some help setting up 2D animated characters.
I do have an animation controller, however it is not currently implemented. I want to finish the walking animation properly so that I can then give it to the animation controller. The reason that I am changing sprites is because there are multiple foot sprites for the character as his foot bends. If you can come up with a way to make this through an animation controller then I would be happy to listen, but i don't know of a way to only change the sprite in the controller.