Collider issues... :(

I’m not sure what I’m doing wrong… I’ve done this before on other projects and it worked fine. So my issue right now is when Object A hits Object B nothing happens…

I wanted to reach out to the community to make sure that I have everything set up correctly.

In Unity I have two game objects. objectA has just a box collider(Is Trigger is unchecked), Mesh Renderer and a script attached to it. objectA is also being instantiated upon a key press. objectB has a box collider(Is Trigger is CHECKED), Mesh Renderer and a script attached to it.

What I want to happen here is simple. When objectA collides with objectB, something will happen.

The script attached to objectA only has code to make it move via transform.translate.

Below is what I have for objectB script.

#pragma strict

function OnTriggerStay(other:Collider)
{
     if(other.gameObject == GameObject.Find("objectA"))
     {
          //do something
     }
}

Am I missing a step that I’ve forgotten or shouldn’t this be working?

Blah. Of course I figure it out after I post something… I was missing a rigibody…

Okay - Now my issue is that it seems my game objects are moving to fast for the script to pick it up. What’s the best way to fix this? So objectA moving at a speed of 8 will get picked up by the collider/trigger. But…if objectA is moving at a speed of 16 it passes right through the trigger/collider without anything happening…

I think this is a Frame Miss issue , you might want to Raycast to check collision in stead

You could use OnTriggerEnter not OnTriggerStay, also use a tag not GameObject.Find as the latter is slower.