Search Unity

Question Object's transform position is not changing by animation

Discussion in 'Timeline' started by juanchocoreano, Apr 4, 2023.

  1. juanchocoreano

    juanchocoreano

    Joined:
    Oct 21, 2021
    Posts:
    8
    Hi! I am trying to practice with Timeline by following some tutorials.

    But unlike the tutorials, with the animation I have, the character's position not moving.
    When I try my character to walk , the animation works but at the same position.

    Can you tell me how to move the character by animation?

    Thank you
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    There is the concept of "root motion" which means the animation clip can change the position of the character. Some animation clips don't include root motion, there is a setting on the Animator component from memory, there are Timeline settings, ... Sorry I don't have a precise answer on me just now, but I would look for "root motion" settings - you probably have one of them turned off somewhere.

    Alternatively you can animate the position of the character separately like any other property in an Animation Track. Set a keyframe at the start for the start position, set another keyframe at the end position you want. Timeline will then move the root X,Y position based on those two positions. But you have to get the timing right or else the character can ice skate (the movement of the feet speed won't match the ground speed). Hence root motion is better if you can use it.