• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by publicst · Jan 01, 2015 at 11:53 PM · c#collidertagboxcollider

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?

alt text

triggerableissue.png (60.9 kB)
Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image

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?

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image publicst · Jan 03, 2015 at 05:14 PM 0
Share

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.

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

how to teleport player to another gameobject using the players tag? 0 Answers

łatwy problem dla początkujących z kolizjami. 1 Answer

Distribute terrain in zones 3 Answers

How can to convert it on c#? 1 Answer

Multiple Cars not working 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges