Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Bug Sprite Animation is Jittery When Moving Diagonally

Discussion in 'Animation' started by XenonBalance, Sep 12, 2023.

  1. XenonBalance

    XenonBalance

    Joined:
    Aug 22, 2023
    Posts:
    1
    upload_2023-9-11_20-48-36.png

    Here is my animator set-up at the moment.

    If I move in a direction along the x and y axis, then the animation is fine--no jitters. However, when I move diagonally, the character rapidly switches between the two animations that correspond with the directions the player is moving. (eg. moving Northwest switches between Idle_Left and Idle_Up)

    I have "Exit Time" and "Fixed Duration" unchecked, and I have "Transition Duration" set to 0.

    How do I fix this? If you need any clarification to the question, or any code that provides context to the issue, I would be happy to provide.
     
  2. sildeflask

    sildeflask

    Joined:
    Aug 16, 2023
    Posts:
    329
    you need to add extra code, dont call for the animation to change if you are already walking in a certain direction
     
  3. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,626
    What are the conditions of your transitions between Idle_Left and Idle_Up?

    Remember that floats can be imprecise, so if you're riding the line between two ranges you could expect to see some oscillating.