OnControllerCollider() isn't called by specific objects in movement

Aahhh collision handling is the biggest headache that I have in Unity. I’ll talk about my problem but if you don’t know how to solve it and you know some problem that can make the OnControllerCollider does not be called, please talk it here. It can help me to debug the problem.

Well my problem is that in one very specific occasion the OnControllerCollider() inside of my player script isn’t called. This occasion is after executing an attack and don’t pressing any key after it. It happens something like the following pic (it is a cannon shooting Sunflower Seed bullets in the direction of the red arrow, going through the player ):

The player has a Character Controller and it’s moved using the Move() function, the bullet has a box collider and it is moved using this function:

		bulletTransform.Translate( Quaternion.Euler( 0, 0, bulletBehaviour.angle ) * speedAuxVector * Time.deltaTime,  Space.World);

Both objects have rigidbodies with Continuous collision detection, some things that I think that aren’t the cause of this problem:

  • Speed: The bullet can be veeeeerryyy slow, like 0.5 units per second , even this way the OnControllerCollider isn’t called;
  • I checked the collision layers on the manager and in the game play and it seems fine;
  • All game objects and its colliders are properly activated;
  • Even with the bullets going through the player without activated the function, it stills calling the OnControllerCollider for the ground collision, I have this debug code and it keeps printing the name of the ground:
function OnControllerColliderHit ( other : ControllerColliderHit )
{
	Debug.Log("PlayerLife" + Time.time + other.collider.name  );
...
  • Excluding this special occasion, the bullet collision is detected normally, even with high speed (40 units/s) or with strange collision angles (if you watch the boss video from my game you can see some bullets with strange movements, and the collision works fine)

Well that is it, I know how to trigger the problem, but I don’t know the origin of the collision fail, so I have no idea where to look to fix it, halp me :frowning:

Have you tried using Rigidbody.MovePosition rather than Transform.Translate to move the bullet?
Are you moving the bullet object in FixedUpdate?

Yeah, I just tried to used Rigidbody.MovePosition and the problem persisted. I used this function with FixedUpdate, for the transform.Translate do I need to call it inside of a FixedUpdate too?

Now I noticed one thing, if I use OnTriggerEnter instead of OnControllerCollider on my player script and change the bullet collider to a trigger collider, it works fine, what is the sense of this error? :frowning:

Bump :o