cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get transform of index finger tip?

omtron
Protege
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?
2 ACCEPTED SOLUTIONS

Accepted Solutions

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

View solution in original post

omtron
Protege
Solution:

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

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

View solution in original post

6 REPLIES 6

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

omtron
Protege


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?

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

omtron
Protege

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.

omtron
Protege
Solution:

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

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

pjenness
Rising Star
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