Search Unity

Moving Bone Transform During Animation

Discussion in 'Animation' started by p1zzaman, Jan 22, 2017.

  1. p1zzaman

    p1zzaman

    Joined:
    Jan 1, 2017
    Posts:
    64
    Hi,

    I have this script where i want to move the dog's head and have it look at the player. However, here's what I have observed:

    1. If I do not call Animator.Stop(), the code that moves the head will not be reflected, or maybe it's fighting the animator frames

    2. If I call Animator.Stop(), the code that moves the head will work, but I cannot resume the animation

    3. If I call Animator.speed = 0, it will pause the animator, but the code that moves the bone transform still does not work. Calling Animator.speed = 1 afterwards does resume the animation though.

    So my question is, what is the best way to move the bone transform via script and also successfully continue playing the other animations afterwards?

    -Rob