The two game objects I want to check collisions against are a static plane with a box collider, and a cube with a non-kinematic rigidbody, but the OnCollisionEnter event never fires. Judging by the documentation at the bottom of this page, and all other documentation I can find, all of the things that need to exist for the event to happen do in fact exist. I have also tried to set the plane as a trigger in conjunction with OnTriggerEnter, but still no luck. 
Chances are I’m missing something small from looking at this for too long now, which is why I have included a package for others to take a glance at. This package, which is quite small and to the point, was built on Unity 4.2.2f. Any help would be greatly appreciated!
I have been running the project by starting the cube on the same x and z coords as the “switch” and just raising the cube up on the y axis. This way it falls on the switch and the collision event should trigger.
1404280–72999–$Collision_Testing.unitypackage (192 KB)
Works fine here. Collision messages on both, Box and SwitchTarget. Is the colision occurring at all, or it’s just the messages that are missing? Perhaps there’s something wrong with your collision matrix or other physics settings?
Best regards,
Peter.
In 4.2.2 if I pull the package into a new empty project, without touching any physics layers, it won’t send the message. I am now in the process of installing 4.2.1 now to re-test.
What version of Unity are you running, and did you change anything to get the messages to print to console?
I’m running 4.2.2. Clean project as well, no changes, just pressed “Play”.
The collisions are occurring, but the messages are never sent for any objects. I even downgraded to 4.2.1 just now, but without luck. I think I need to perform a clean install of Unity to see if that fixes things.
Sorry to ask so many questions, but could you please answer a few more? I’m pulling my hair out trying to figure this out!
- What platform are you running on? (Win32-64/OSX)
- Do you have Unity Pro?
- Did you change any projects settings at all?
- Do you have default global settings on your Unity install?
- Did you receive output in the Console window saying that the collider was hit for both objects?
Thanks for taking a look at everything for me. It would seem that I just can’t get it to work no matter what. I’ll need to run on my OSX machine later to see if it has the same issues. Weird!
LOL, I feel kinda dumb now. Turns out the button to show debug output was toggled off in the console window. That type of functionality should NOT carry over from install to install, but all is good now.
Didn’t see that one coming 
You and me both. Keeps me honest I guess. 