Search Unity

Animator always overrides scripted animation ??

Discussion in 'Animation' started by VincentAbert, May 9, 2020.

  1. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello everyone !

    I'm a beginner in unity, and I can't figure this out despite quite a lot of research : I want to animate the emission of a GameObject's shader, which I can do with a script (nice if I want the emission to be proportional to the velocity for example), and with the animator (useful for more complex prerecorded behaviours). The thing is, whenever the animator is activated, unity ignores all my scripted animations. When I discovered the additive mode of animator layers I thought it was solved, but same problem... Am I doing something wrong here ?
    Is there a way to do this ?

    Thanks a lot !!
     
  2. elliot_eserin

    elliot_eserin

    Joined:
    Jan 5, 2020
    Posts:
    38
    Are you doing the scripted animations in LateUpdate or OnAnimatorMove? because if not, the animator will always evaluate after any Update functions and override any scripted animations that are done in Update.
     
  3. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    I had put it in Update at first, after finding a post I switched to LateUpdate, but no chance either