I've been wrestling with the collision system for a week now and I really, really need help.
I have two objects, both with box colliders and rigidbodies. In my game, they collide quite frequently--in the setup I have now, one runs right into the other and pushes it along the ground. However, this code is in one of the objects:
But it simply doesn't work. It will never print the name of the collider. I have a similar object that uses a trigger because it doesn't need the physics engine and it works just fine, but this never, ever works.
Can someone please help me understand why this isn't working? I've tried changing to sphere colliders with no luck. It still works as it does now, but the code never, ever triggers.
Does it throw an error? Did you try putting in a Debug.Log("Hit!") or something to see if the code is actually being run? If anything, perhaps it should be print(whatHitMe.gameObject.name) ?
answered Jan 18 '11 at 08:54 PM