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. Dismiss Notice

Get Bone Transform From Avatar With Generic Rig?

Discussion in 'Scripting' started by Jick87, Dec 17, 2017.

  1. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    I posted this over on Answers but have yet to get a response, so I figured I might try posting here as well...

    Is it possible to get the Transform of a bone in an avatar with a generic rig?

    I have an object with a generic Animator rig which has "Optimize Game Objects" enabled on it. Is there any way to get the Transform details of the bones?

    With a humanoid rig you can use Animator.GetBoneTransform( ... ) but that doesn't seem to work for me. I'm guessing because it is a generic rig.

    I know I could just turn off "Optimize Game Objects" and have access to the hierarchy, but I was trying to avoid that if possible.

    So can this be done? Or do I just need to go the "Optimize Game Objects" route?

    Thanks.
     
  2. Hanross

    Hanross

    Joined:
    Aug 11, 2018
    Posts:
    11
    did u find a way ?
     
  3. Jick87

    Jick87

    Joined:
    Oct 21, 2015
    Posts:
    124
    Unfortunately, no.

    I just ended up exposing the bones I needed and using them that way. Wasn't the ideal solution, but it seems to work ok for now.

    Maybe one day there will be a better solution...