I have two objects
Object one (Flight ‘Player’)
Rigidbody + BoxCollider no trigger
And a script attached to for the movements im using physics for movement (Adforce).
Object Two (Turret ‘Enemy’)
It has a Box Collider with Trigger No rigidbody
And a script attached to it as follows
function OnTriggerEnter(other : Collider)
{
Debug.Log("entered......" + Time.time);
if(other.gameObject.tag == "Player")
{
Debug.Log("Its the Player"+ Time.time);
}
}
function OnTriggerStay(other : Collider) {
//Debug.Log("OnTriggerStay: " + Time.time);
}
function OnTriggerExit(other : Collider)
{
Debug.Log("Exit Called."+ Time.time);
}
It seems whenever the player moves within the collider the trigger will activate onTriggerEnter and once I stop moving it activate OnTriggerExit EVEN THOUGH IM STILL IN THE COLLIDER….?
Help out, is this a bug in Unity.? What im doing wrong.?