Search Unity

Sprite animation showing in preview but not in Game view

Discussion in 'Animation' started by ma.parizeau, Nov 16, 2013.

  1. ma.parizeau

    ma.parizeau

    Joined:
    Mar 21, 2010
    Posts:
    116
    Hi all,

    I'm trying to get my animations to work in my game. I've used the script that comes with the 2D demo for Unity 4.3 Everything works fine with one exception... My animations are not appearing in game.

    If I play my game and I have my player selected in the hierarchy, I can see that everything works fine in the animator for going from one animation to the other, in the preview window, I can see that the right animation is playing. But in game view or scene view, Nothing... The sprite stays the same.

    I've started over and over making sure that all my settings are the same in my game as they are in the demo but still the same problem. The only difference is that in the demo, they are moving parts where mine is a sprite sheet that I'm using.

    There is one weird thing when I'm configuring the transition in the animator, When I press play to view my transition animation, I get the top sprite that is not moving and one in the background moving... is this a normal behavior? I'm assuming not ??!!??

    Thanks for any help you guys can give,
     
  2. ma.parizeau

    ma.parizeau

    Joined:
    Mar 21, 2010
    Posts:
    116
    Solved it

    The sprite renderer and the animator needed to be on the same gameobject, In the demo they are not on the same gameobject but they are moving parts while i.m animating a prite sheet. That might explain... or not why!.