Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨

2 Replies

  • Hi xinuo.2023! The Interaction SDK package makes this all easy to achieve:

    Let me know if that helps!

  • Big_Flex's avatar
    Big_Flex
    Meta Employee

    Hi xinuo.2023, I work on the Interaction SDK team, so tag me if you have any future questions or comments! I'd use one of the joint methods from the IHand script. The GetRootPose method would work well, but feel free to test the others. Since IHand is already implemented by GameObjects like HandDataLeft, you can reference one of those GameObjects in a script to access the method.

    Here's an example of a custom script accessing a bone location. A full list of bones is in the HandPrimitives script as part of enum HandJointId.

        using System.Collections;
        using System.Collections.Generic;
        using UnityEngine;
        using TMPro;
        using Oculus.Interaction.Input;
    
        public class LogBoneLocation : MonoBehaviour
        {
            [SerializeField]
            private Hand hand;
            private Pose currentPose;
            private HandJointId handJointId = HandJointId.HandIndex3; // TO DO: Change this to your bone. A full list of bones is in the HandPrimitives script in enum HandJointId. 
    
            void Update()
            {
                hand.GetJointPose(handJointId, out currentPose);
            }
        }