- Home /
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.
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.
Have you double checked the Physics $$anonymous$$anager to ensure that collisions between the layers of your objects are being calculated?
Answer by RabidCabbage · Mar 20, 2015 at 05:54 AM
Try increasing the Solver Iteration Count
Edit > Project Settings > Physics
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?