Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question If I use DirectorUpdateMode.Manual, how can I change rig weight?

Discussion in 'Animation Rigging' started by Sakura_Nekomi, Apr 27, 2023.

  1. Sakura_Nekomi


    Mar 28, 2023
    I`m trying to make a footIK for Generic.
    I set my RigBuilder onOnEnable:

    Code (CSharp):
    1. m_RigBuilder = GetComponent<RigBuilder>();
    2.         if (m_RigBuilder.Build())
    3.         {
    4.             m_RigBuilder.graph.SetTimeUpdateMode(DirectorUpdateMode.Manual);
    5.         }
    But if I used DirectorUpdateMode.Manual,I can`t change the Rig Weight even on Update.
    It will set by Animator.Rebind() ,maybe on ProcessAnimation.

    plz help me ;(

    ps:if I set Weight and used RigBuilder.Build();it`s work,but is it the only one way?
  2. fleity


    Oct 13, 2015
    Welcome to a whole world of pain.

    I have been working with a similar setup for the past 6 months and every few weeks this comes around to really really cause a lot of pain (either animation or rigging not working at all or like right now complete crashes of the engine).

    As far as I can reconstruct it, if you manually evaluate the playable graph you are breaking the interleaving (and threading!) of rigbuilder and animator which causes one of both to write their default values while the other one has already cached their values for the current frame.
    If you let unity just handle this they magically make this work as

    I have a collection of threads dealing with parts of similar problems if you are interested, maybe some of the posts will help you figure out how to work around your problem.

    If you want to go this route of manually updating you probably need to build the rig graph into the animator graph using

    but be warned this crashes the editor for me when disabling and reenabling the character. All in all I would recommend you to just stay away from fiddling with Rigbuilder.Build and manual update mode completely, just let the engine do it's thing, set everything to update as normal in solve your setup some other way.