OnCollisionEnter not running.
I'm trying to allow my player to detect collisions to walls but nothing would happen, i soon realized the problem was happening because OnCollisionEnter was never running no matter what i was collided with. My wall has a box collider and a rigid body with is kinematic ticked and my player has a character controller and a capsule collider. No idea why this isn't working, please help. My code looks like this:
void OnCollisionEnter(Collision other){
print ("Wall");
}
this is running after update().
Answer by James_BadAlchemy · Jan 29, 2017 at 05:32 PM
This is a shot in the dark, as i am no expert myself. But play your scene and go into the editor and drag your player INSIDE OF your wall. See if that triggers it. I don't normally use OnCollisionEnter() for collisions.
Yes, when I am inside the wall it works but only when I'm on the edge.