Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How rotate some bones over the animator?

Discussion in 'Animation' started by Mauro1965, Feb 28, 2020.

  1. Mauro1965

    Mauro1965

    Joined:
    Aug 31, 2019
    Posts:
    27
    I'm trying to rotate some bones in separate way respect the active animation.
    I mean for example rotate a shoulder bone in addictive mode respect the animation using directly the transform.rotation inside the C# script.
    I tried to mask the bones in some animator layers,make the rotation in LateUpdate() , but the animator always overrides my rotations.

    Exist a way to take a control or override upon the animator?
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,491
    Any modifications you make in LateUpdate will take effect for that frame only, then next frame the animation will be applied to the bones again so if you want to keep your modifications you need to apply them again every LateUpdate.
     
  3. Mauro1965

    Mauro1965

    Joined:
    Aug 31, 2019
    Posts:
    27
    Thank you, you are right, my test code fail because i'm not always write the rotation in lateupdate().
    I just discovered UnityEngine.Playables, i mean animator.BindStreamTransform() & C.
    This should allow to handle directly some bones inside the animation.
    The examples use a fixed animations as inputs , I was wondering how to connect the normal animator output instead a simple animation so you can use all animator states and layers, Is it possible?
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,491
    That's part of the Animation Jobs system which I don't really know much about, sorry.