OnControllerColliderHit doesn't work with CharacterController objects and Move action

Hi,

I am making a multiplayer network game with Unity 4.

In my scene, I have 2 characters with this attached scripts :

The IpartyCharacterController is my custom implementation for use CharacterController properties and manage movements and animations.

The PhysicsTightrope script manage players’collisions.

This is the code of this script :

using UnityEngine;

public class PhysicsTightrope : MonoBehaviour
{
    public PhysicsTightrope()
    {
    }

    #region MonoBehaviour Events


    public void OnControllerColliderHit(ControllerColliderHit hit)
    {
        Debug.Log("Collision de " + this.transform.name + " avec " + hit.collider.name + " (OnControllerColliderHit)");
    }

    public void ReceiveMessage()
    {

    }

    public void OnCollisionEnter(Collision _other)
    {
        Debug.Log("Collision OnCollisionEnter");
    }


    public void OnCollisionExit(Collision _other)
    {
        Debug.Log("Collision OnCollisionExit");
    }


    #endregion

}

Very simple, but… it doesn’t work.

I put my characters in a very simple configuration :

With gravity, MyCharacter1 will fall on the MyCharacter2.

Here the log result :

1223198--50756--$aide3.png

There are only collisions between the ground and characters… (I want detect player - player collision).

The problem is the same when a character .Move() and touch an other character (no collision detection).

Thank you very much for your help.

If necessary, I can give more details about this problem.

Nobody can help me?

Hi, my problem is not resolved :frowning:

Size of your character colliders seem small 0.1 radius and height try increasing their size.

Also your rigidbody should be kinematic, as you will be moving it via the character controller.

You should not have both a CharacterController and a Rigidbody on a single GameObject. Use one or the other.

I deleted ridigbody and i increase radius, but it seems that the collision between the players was not detected.

1224315--50880--$2char.png

1224315--50876--$collision.png
1224315--50877--$collision2.png

Ok this is different as your reset zone is a compound collider system and therefor the top level collider will be called which is your Gamezones object with any impacts to lower level colliders.

Try separating out your reset zones so they are not the children of other objects or check out help on dealing with compound colliders.

I do not know if you understand fine my problem.

I want detect collision between a player and an other (Char1 and CloneCharacter). Actualy, I put a character that falls on the other with gravity effect. The collision between the two characters is not detected. But the collision between my character and the ground area is detected…

Any ideas ?

Hi - there are a bunch of things to try if you have a look at the answers hits, for example:

And some further docs for colliders/player

I hope this helps solve your conundrum!