Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
omtron's avatar
omtron
Protege
9 years ago
Solved

How do I get transform of index finger tip?

In Unity I'm trying to add a laser appear out of index finger when player points, but I can't figure out how to select the tip of the index finger. Is transform.Find("hands:b_l_index_ignore") the only way? Because in that case I have to SetActive(true) on all children, do the Find, then SetActive(false) on all children again. I guess would work, but there has to be a better way that I missed?
  • Create a public or a serialized variable for it in a script and drag the transform to the slot in the property inspector.
  • Solution:

    I added this to the end of AddAvatarComponent() in OvrAvatar.cs:

            try
            {
                middleFingerTip = GameObject.Find("hands:b_r_middle_ignore").transform;
            } catch
            {
                return;
            }

6 Replies

Replies have been turned off for this discussion
  • This should be in the Unity section of the  Developer forum. I'll move the thread.


  • This should be in the Unity section of the  Developer forum. I'll move the thread.


    Thanks for moving the thread for me... Any idea on how I would get the Transform of tip of the index finger?
  • Create a public or a serialized variable for it in a script and drag the transform to the slot in the property inspector.

  • js2k said:

    Create a public or a serialized variable for it in a script and drag the transform to the slot in the property inspector.


    Thanks. I know how to use Unity, but the problem is that the child hierarchy doesn't show up until runtime when I use the default localavatar prefab.
  • Solution:

    I added this to the end of AddAvatarComponent() in OvrAvatar.cs:

            try
            {
                middleFingerTip = GameObject.Find("hands:b_r_middle_ignore").transform;
            } catch
            {
                return;
            }
  • Hiya

    I had the same issue finding the hand joint, and yeah I manually traversed the heirarchy to get it (I knew it was 3 steps so it was fine.) For some reason the find didnt work for me. (maybe its that setActive step you mention)


    -P