Rick74
1
All I’m trying to do here is detect the exit of an object. Enter works fine, stay works fine. If I delete the object while it’s in collision, Stay detects that as well…
But by golly if I just simply move the object out of collision…nada…nothing. No detection!
Here’s the code. It’s simple, and I sure can’t figure out what it is I’m doing wrong here.
#pragma strict
var myTarget : GameObject;
var myMaster : GameObject;
function Update ()
{
if (!myTarget)
{
myMaster.GetComponent(alienScarFace).myTarget = null;
myTarget = null;
}
}
function OnTriggerStay (other : Collider)
{
if (other.gameObject.tag == "farmer")
{
myMaster.GetComponent(alienScarFace).myTarget = other.gameObject;
myTarget = other.gameObject;
}
}
function OnTriggerExit ( other : Collider )
{
if ( other.gameObject == myTarget )
{
myMaster.GetComponent(alienScarFace).myTarget = null;
myTarget = null;
}
}
anyone have any ideas here? I’ve probably overlooked something simple…again! 
Rick74
2
Sigh.
I’m sorry guys.
“is kinematic” was not checked…
How embarassing… :(.