I need help adjusting the way two characters using Character Controller and FPS walker work.
I've made it so that they'll register when they collide into one another, they will check what the terrain is like. If certain objects are present, the first one will be destroyed but not the second one. IF they aren't present, the second character will be destroyed, but not the other.
I don't think they're registering each other's presence. Nothing I'm doing seems to get one to destroy the other.
this is the code I'm using:
var hit : RaycastHit;
function OnTriggerEnter(CollisionInfo : Collider){
if (collision info.gameobject.tag == "Samurai"){
if (Physics.Raycast (transform.position, new Vector3(1,0,1), hit, 10) ){
if (hit.collider.gameObject.tag=="Shadow") {
Destroy(collisionInfo.gameObject);
}
else {
Destroy (gameObject);
}
}
}
}
I think I know PART of the problem, which is I have two objects using CharacterController, and not one object with CharacterController and one with some collider in it, but I have no idea what I'm supposed to do to fix the problem.