Search Unity

Prevent animator from affecting rigged eye

Discussion in 'Animation' started by calebc01, Jul 24, 2016.

  1. calebc01

    calebc01

    Joined:
    Jul 21, 2015
    Posts:
    62
    I have an animated creature that I'd like to program to look at the player via a script. Unfortunately, the eye is animated and when the animator is turned on, I can't manually set the eye rotation.

    This works when the animator is turned off:

    Code (csharp):
    1.  
    2. void Update()
    3. {
    4.      if (_attackTarget != null)
    5.      {
    6.          _eyeball.LookAt(_attackTarget);
    7.      }
    8. }
    9.  
    I've gone into the animation import settings and cleared the mask on the eye, so that animations can't rotate the eye. That works great, but apparently the animation controller *still overrides anything I apply, even when the individual animations aren't changing it.

    Anyone have an idea how to get this to work?
     
  2. calebc01

    calebc01

    Joined:
    Jul 21, 2015
    Posts:
    62
    Ah, figured it out - using LateUpdate() instead of Update() apples the changes after the bone animation is complete.