Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is it possible to access bone rotation while animation is playing?

Discussion in 'Scripting' started by pizzaboy13, Jan 9, 2020.

  1. pizzaboy13

    pizzaboy13

    Joined:
    Mar 6, 2019
    Posts:
    18
    I want to get the rotation of the bone (i.e. elbow) and apply a corrective blendshapes (i.e. jcm_elbow_90) according to it's rotation.
     
  2. adi7b9

    adi7b9

    Joined:
    Feb 22, 2015
    Posts:
    181
    Make a var into your script:
    Code (CSharp):
    1. public Transform elbow;
    in the inspector drag and drop your bone to "elbow" variable
     
  3. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,616
    In addition to what adi7b9 said, I think you will need to check the rotation of the object in LateUpdate becaue I don't think the animation will be applied until after Update has already finished.