RemiR
April 18, 2013, 10:51am
1
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 :
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.
RemiR
April 19, 2013, 1:32pm
3
Hi, my problem is not resolved
Arowx
April 19, 2013, 2:44pm
4
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.
RemiR
April 19, 2013, 4:00pm
6
Arowx:
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.
I deleted ridigbody and i increase radius, but it seems that the collision between the players was not detected.
Arowx
April 19, 2013, 4:47pm
7
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.
RemiR
April 19, 2013, 5:00pm
8
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…
Hi - there are a bunch of things to try if you have a look at the answers hits, for example:
I’m having an issue with two gameobjects representing players. Collision works when they run into items on the map (which makes sense since that’s local for each of them), but they don’t seem to successfully collide with each other. Instead, they...
And some further docs for colliders/player
I hope this helps solve your conundrum!