Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Animator blocking movement - why?

Discussion in '2D' started by oHoodie, Jan 15, 2015.

  1. oHoodie

    oHoodie

    Joined:
    Jan 15, 2015
    Posts:
    3
    Hello everyone I'm quite new to Unity and I have the following problem:

    I have 2 animations for my character (Idle and walk) but there's a strange conflict between the animator and the rigidbody. No physics (and no movement at all) is applied to my character when the animator is active. When I deactivate the animator gravity is applied to the character. This occured when I added the second animation to the Animator. When I remove the second animation (and only have the Idle animation in the animator), physics and movement are working again.

    I have "Apply Root Motion" unselected and Update Mode to normal. If I select "Animate Physics", my character is looking really buggy (moving up and down very quickly).

    I appriciate any help. Thanks in advance :)
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    897
    Does your animation animate the position in any way?
     
    theANMATOR2b likes this.
  3. oHoodie

    oHoodie

    Joined:
    Jan 15, 2015
    Posts:
    3
    Yes in the Idle animation the body of my character is slightly moving up and down and I use the rotation of the upper and lower leg parts to keep him on ground-level.
    Shouldn't I do that?
     
  4. DoubleNibble

    DoubleNibble

    Joined:
    Nov 15, 2012
    Posts:
    22
  5. oHoodie

    oHoodie

    Joined:
    Jan 15, 2015
    Posts:
    3
    Thanks a ton for this hint!
    I had the position of the parent-object animated and that caused all the strange behaviour. I removed this property from the parent and instead animated the position of the child-sprite.
    My character... he's walking now! :D