Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
This question was closed Mar 11, 2013 at 02:23 PM by Fattie for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by hakermania · Mar 11, 2013 at 01:05 PM · collisionrigidbodymeshcollider

Mesh Collider & Rigid Body fail to detect trigger

I have a pocketknife inside my project which I imported through a .blend (Blender) file.

I want to have it as a collectable item by the user and thus, I want it to rotate and disappear once the MainChar has collided with it. So, I've added to the pocketknife a rigidbody (without the use of gravity because I want it to be on the air). Then, I've added to it a Mesh Collider whith 'Is Trigger' checked. Then I've attached this script to the pocketknife:

 function OnTriggerEnter(hit:Collider){
     Debug.Log("Something hit me!");
     if(hit.gameObject.name=="MainChar"){
         Destroy(gameObject);
             hasKnife=true;
     }
 }

I don't even get the Something hit me! message...

Comment
Add comment
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

3 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by hakermania · Mar 11, 2013 at 02:23 PM

Altering the collider's size fixed the problem.

Comment
Add comment · 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
0

Answer by jonnydjango · Mar 11, 2013 at 01:25 PM

You don´t need a rigidbody for this. Why don´t you ad a box collider, check "is Trigger" an try it this way? Box Colliders are better for performance.

Comment
Add comment · 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 hakermania · Mar 11, 2013 at 01:39 PM 0
Share

Thanks for the answer, this wasn't actually the problem. The problem was that I had the collider's size to 0!

avatar image
0

Answer by hakermania · Mar 11, 2013 at 02:23 PM

I found the solution: My collider's size was set to (0, 0, 0) !

Comment
Add comment · 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

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Anyway to make my object not fall through the floor without convex? 0 Answers

Fast moving object not detect collision 3 Answers

Why I've a gap between meshcolliders? 0 Answers

Collisions aren't colliding all the time 0 Answers

Detect collision between kinamatic rigidbodie and gameobject without rigidbody but with colliders 0 Answers


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