Collision CharacterController vs CharacterController

Hi,
I have my player character defined with a CharacterController, and I move my enemies the same way (with other CharacterControllers). The thing is, I was thinking about using OnControllerColliderHit for when my character is hit by enemies, so that he goes back hurt.

The problem is that OnControllerColliderHit seems to trigger on just when it hits a Collider, and as my enemies don’t have a collider, but a CharacterController to move them, it’s not working!

Is there a way around this? I don’t want to change my enemies from being CharacterControllers, because both enemies and main character inherit from the same class (which has a CharacterController of course).

Thanks a lot!!

Why not set enemies to have a certain tag like “Enemy”, and do an OnTriggerEnter(Collider col) for your character, wherein you use:

if (col.gameObject.tag == "Enemy") {
   //whatever you wanted to do here
}

You’re right: that’s a weird thing to not have a character-character collision event! But maybe @zeldarulah’s suggestion can do what you want: add a trigger volume to the character and a kinematic rigidbody (moving triggers need it to work); when the collision happens, calculate a “fake normal” based on the position of both characters - like this:

function OnTriggerEnter(other: Collider){
  var normal = (transform.position - other.transform.position).normalized;
  // this fake normal shows the direction from the other to this object, 
  // somewhat like hit.normal would do (if it worked, of course)
}

Notice that you must add the collider to the character (Unity asks if you want to add or replace the current collider).