Search Unity

Animation timing out of sync

Discussion in 'Animation' started by Kurdiez, Jun 7, 2019.

  1. Kurdiez

    Kurdiez

    Joined:
    Feb 6, 2017
    Posts:
    72
    My problem is explain in the following video:


    To summarize here is the problem I am trying to solve:
    - I have 2 characters I am making them walk on the hex tile map one tile at a time.
    - First character animates and walks fine.
    - Second character, even though it uses exactly the same mechanics, has 2 problems
    - Does not immediately play the walking animation when it begins to walk (transform.position changes)
    - Does not immediately stop the animation when final destination is reached
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I'm not seeing anything wrong with your code, but the problem doesn't really make sense. If it only happens for one character but not the other then you obviously just need to figure out what's different between them. Does it happen with only one character? What about three? Maybe it's even worse on the third one or something. Is it related to their starting location? path distance? Etc. Just keep trying things to narrow down the potential cause.
     
    Kurdiez likes this.
  3. Kurdiez

    Kurdiez

    Joined:
    Feb 6, 2017
    Posts:
    72
    I found the solution. It was the little checkbox that was ticked.
    When I removed it, everything started working as expected.

    upload_2019-6-8_10-0-7.png
     
    RFMatt likes this.
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Yeah, that's the trouble with Animator Controllers. Instead of simply knowing that "incorrect behaviour = incorrect code", you lots of different places to check for a problem and most of the time you just end up fiddling with things blindly until something seems to work (and hope you don't break anything else while doing so).