- Home /
Question by
deeds0l · Apr 06, 2014 at 10:43 AM ·
collision event
How do I get the GameObject that is inside my Collision
I am trying to get the GameObject that is inside my collider radius so that I can access its function using SendMessage. How could I access the gameobject and not only its collider.
I have something like this:
void OnTriggerStay(Collider myTrigger){
if(isExploded)
{
myTrigger.gameObject.SendMessage("explodeEffect", SendMessageOptions.DontRequireReceiver);
}
}
Comment
Answer by deeds0l · Apr 06, 2014 at 01:38 PM
This worked my mistake was destroying the object before I can set isExploded to true.