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?