CharC hits CharC

CharC = CharacterController

my character(main hero) has a CharC, and the enemy has a CharC, when it hits it the if statement should evaluate to true and to work, also the enemy is a child of an emepty gameobject. there’s a tag called monster in my enemy’s gameobject.

function OnControllerColliderHit(hit : ControllerColliderHit){
    if(hit.collider.name.Contains("Lv")) //doesn't work
    {
        print("hit a monster"); // doesn't get printed
    }
}

also tried Debug.Log(hit.collider.name)

I think it might be “hit.collider.gameObject.name” that you’re looking for.

Solution :
to create a cylinder. (same styl as characterController)