Hey guys I am trying to make it so that once my AI hits an interactive object(couch) then he switches to another waypoint, but nothing happens when my AI hits an object, the function is not being called cause I put a debug right at the beginning. I have the couch tagged as “Interactive” and placed this code on the AI. NOTE: this is a long script, I have set currentWaypoint and randomWaypointRange as ints FYI.
function OnCollisionEnter(other : Collision){
if(other.gameObject.tag == "Interactive"){
Debug.Log("Hit an Object");
currentWaypoint = Random.Range(0,randomWaypointRange);
}
}