Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Best Way to deal with 2d sprite animations

Discussion in '2D' started by tunadel, Mar 13, 2018.

  1. tunadel

    tunadel

    Joined:
    Jan 28, 2018
    Posts:
    1
    I was wondering whats the best way to deal with 2d sprite animations. I am currently working in a 2d pixel sprite project and want to know if I should change animations by Input pressing or by the velocity and axis of the player moving. Both working fine till now, but I can't tell if there is going to be problems in the future. (when I add jumping, falling, taking damage animations).

    Anyone with experience can say whats best? maybe any tutorials?
     
  2. Deleted User

    Deleted User

    Guest

    Input pressing an launching an Animation attached to the object is easiest. You know if they use the left arrow key that they have to be moving or facing left.
     
  3. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    Both are fine, it just depends on how you want it to function.
    Say you have a running animation that is controlled by the character's velocity rather than a player input. If the character is then moved by some kind of force such as another game object pushing against it; that animation will play, whereas it wouldn't if you control it via player input.
    If this is fine for you, then stick with it, otherwise go with inputs to control animation.