Ok so I made a node based Path Finding script for generating random paths:
var Waypoints : GameObject[];
function onTriggerEnter (collision : Collider){
if (collision.gameObject.FindWithTag("Enemy")){
var random : int;
random = Random.Range(1,2);
var place : GameObject = (Waypoints[random]);
SendMessage("NextLocation", place, SendMessageOptions.DontRequireReceiver);
Debug.Log("Sent");
}
}
where an Object moves towards a Waypoint determined by the script. The only problem is that the Waypoint with this script never detects the collision with the Object since I never receive the debug. I have a box collider on the waypoint and a rigid body on the object, so I have no idea why it wouldn’t detect the collision. Any ideas?