- Home /
Leap Motion generated hand/finger is untagged. Reason?
As I you can see from the attached image, I have created a prefab of a hand (that is actually holding a gun).
I am only mobilizing the index finger and I would like to trigger a box collider with IsTrigger=true, and I only wanted to trigger this with the finger tip of my index finger.
So I attached a tag to my bone3(the fingertip bone) called "Triggerable" .
However, when I was writing code for OnTriggerEnter, I realized nothing was happening.
So I wrote a test Logging code
void OnTriggerEnter(Collider other)
{
Debug.Log(string.Format("{0} | {1} | trig", other.ToString(), other.tag.ToString()));
}
And realized that my bone3 was losing the Triggerable tag.
What is the possible cause of it?
Answer by tanoshimi · Jan 02, 2015 at 07:21 AM
Bit hard to see from your hierarchy, but it looks like tag is not on the same gameObject as the collider. What if you try testing/logging against other.transform.parent.tag instead?
Thanks for the answer! Im not quite sure if I understood your recommendation.
Collider is attached to the gun's trigger (In the image, it is located at the bottom of hierarchy) and I would like to check if the collider is struck by gameObject with my tag.
By the fact that other.ToString() is returning bone3, I feel I am striking it with correct gameObject. Its just that I am nolonger seeing the gameObject with Tag assigned to it.
If you clicked "triggerableissue.png (60.9 kB)" right below my image, you would be able to see the enlarged image.
Your answer
Follow this Question
Related Questions
How can to convert it on c#? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
CompareTag being ignored? 1 Answer