Search Unity

Tips for Debugging 2D Animation Problems?

Discussion in '2D' started by DeanTheodorakis, May 5, 2020.

  1. DeanTheodorakis

    DeanTheodorakis

    Joined:
    Apr 29, 2018
    Posts:
    53
    Hi everyone.

    Like the title says, I'm curious if anyone has any tips for debugging problems when my game has 2d animation issues.

    Most of the animations work fine, but a few are not working quite right, and I figured it would make sense to ask for how one debugs animation problems as opposed to posting each animation that doesn't work. Sorry if this is flawed logic.

    For context: I'm making a pixel art game with multiple animators on the same character. this is so they can have their armor and weapons switched. Its been working fine so far, but sometimes there are bugs that seem random to me.

    The biggest one is that I have a block move, and while every other piece of the attack works fine, the body layer stands up between repeats in the animation. I have 'has exit time' checked when this move transitions to other moves, so perhaps that is a problem?

    there are other random bugs that I cannot consistently replicate, with regards to just sometimes the animation will freeze on one part of the body...

    Like I said I'm not really looking for one solution to my problem, but hoping I could pick some of your brains on how you debug your own flaws in 2D animation.
     
  2. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    When debugging animations, slowing down the in-game time can be very useful to track down animation transitions and view the blends properly.

    In any of your MonoBehaviours, add
    Time.timeScale = 0.5f;

    to slow the in-game time down by 50%.
    (See more here: https://docs.unity3d.com/ScriptReference/Time-timeScale.html)
     
    barrycook likes this.
  3. DeanTheodorakis

    DeanTheodorakis

    Joined:
    Apr 29, 2018
    Posts:
    53
    thanks ted_wikman. I'll have to try that!