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 /
avatar image
1
Question by pjlx911 · Mar 19, 2015 at 11:38 AM · c#programmingontriggerentertriggersoncollisionenter

OnTriggerEnter/OnCollisionEnter and 5.0

I've been having a really bad issue with Unity 5.0 and the collision/trigger detection...

The problem is that it doesn't work. I know I'm doing everything right, I know I've marked the object that's supposed to trigger/collide as "Is Trigger", I know that I have my player with a rigidbody component, I know that the tag for the player is indeed "Player", I know that I keep calling "other.gameObject.tag == "Player"" until my fingers fall off, and what has that gotten me? Nothing.

This is really frustratingly odd being that Unity 4.7, I had very little troubles with the Trigger/Colliders not working. Now all of the sudden none of the Triggers/Colliders are working. The even odder thing is that I double checked my Unity5 project with the one made in Unity4...Everything worked. It noticed the player, it triggered, it tele-ported the player, everything that I asked for happened.

Now, could someone please explain to me why I'm having this issue.

Here is the code:

 void OnTriggerEnter(Collider other)
     {
         if(other.gameObject.tag == "Player")
         {
             cpCount = cpCount + 1;
 
             Debug.Log(cpCount);
         }
     }

And again, the player has a rigidbody, the thing that I'm supposed to collide/trigger with is checked for "Is Trigger".

Thanks.

Comment
Add comment · Show 9
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 pjlx911 · Mar 19, 2015 at 05:58 AM 0
Share

Okay, I've looked here HERE and I've changed my collision detection for my player object to "Continuous", then "Dynamic Continuous", nothing. I gave the things the player is colliding with a rigidbody, then did the same, nothing.

Am I possibly running into a bug? I think I $$anonymous$$IGHT'VE exhausted all possibilities here. I know I sounded angered (it was more aggravated), but I guess this counts as a little QA from this end. It seems the transition is rough from games made in pre-U5 to post-U5 for collision detection, is there an update I'm missing? Did they fix this issue already? Or should I report this as a bug?

Any help would be appreciated, I'm seriously trying everything to get the collisions/triggers to work, and I'm having no luck.

avatar image pjlx911 · Mar 20, 2015 at 04:04 AM 0
Share

Still...Need some help on this...BU$$anonymous$$P.

avatar image MaxHarper · Apr 03, 2015 at 03:36 PM 0
Share

I have the same problem

avatar image POiD · Apr 03, 2015 at 05:04 PM 0
Share

Have you double checked the Physics $$anonymous$$anager to ensure that collisions between the layers of your objects are being calculated?

avatar image MaxHarper · Apr 03, 2015 at 05:12 PM 0
Share

I restarted the Unity and the problem disappeared

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by RabidCabbage · Mar 20, 2015 at 05:54 AM

Try increasing the Solver Iteration Count

 Edit > Project Settings > Physics
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 SilverStorm · May 28, 2015 at 05:29 AM

Have you tried having rigidbodies set on Both objects; the character and the trigger object?

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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 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

Related Questions

Multiple Cars not working 1 Answer

Play animation OnTriggerEnter (C#) 1 Answer

Can not get OnTriggerEnter and OnCollisionEnter to work!? 1 Answer

How to make gameObject make only one collision 1 Answer

OnCollisionEnter() not getting called between two rigid bodies 3 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