Search Unity

Code driven animation controlled by Mecanim

Discussion in 'Animation' started by Tschipp, Jun 16, 2022.

  1. Tschipp

    Tschipp

    Joined:
    Nov 26, 2018
    Posts:
    2
    I have a locomotion system that's driven entirely in code. It returns the bone rotations for the next frame.
    I'm trying to integrate this system into the mecanim animation system, so that it can blend together with other normal animations.
    I've created a StateMachineBehaviour and am trying to build on this, in particular I thought of using OnStateIK, but I don't really understand how it works or what I need to do inside the method.
    What I observe right now is either the regular animations completely override the code driven anims, or only the code driven anims work but not the regular ones.
    Any ideas?