- Home /
How do I get my animation with two sprites to play?
I am trying to create an animation pixel art campfire that loops. I have a sprite sheet with two sprites for the animation.
I put a 'SpriteRenderer' and 'Animation' components onto a GameObject.
I then create a new animation clip.
I then try to keyframe the two different sprites on the animation timeline.
If I hit record and change the sprite, then the other keyframe sprite also changes.
If I drag both sprites onto the animation timeline, then I can see that the two sprites are different, but nothing changes when I play the animation.
What am I doing wrong? This seems like it should be simple and straightforward for such a basic 2 frame animation.
PS: If I keyframe a change in the transform like position or scale those animations play, but not the sprite.
Screenshot:
I suspect the 2nd key frame to not "last long enough" meaning the sprite renderer shows the 2nd sprite and instantly changes back to the 1st one.
Can you ensure your animation lasts a bit more after your 2nd keyframe? You may need to add a third one with the 2nd sprite.
Hi Hellium, thanks for your reply. The first sprite in the animation is different to the default sprite I put in the sprite renderer so I think I should be seeing the change when the animation starts. I tried making it longer as well with more key frames and it still doesn't do anything when I hit play.