I have a problem with onTriggerEnter function as it doesn’t seem to be called no matter what I do.
Things I have so far
- Collider on both objects and Trigger checked on object I move
- Rigid body on object I move
- Script added to object I move
Script on the object:
#pragma strict
var trigger : boolean;
function Start () {
}
function Update () {
}
function onTriggerEnter (other:Collider) {
trigger = true;
}
function OnGUI () {
if (trigger == false) {
GUI.Label (new Rect (20, 60, 100, 30), "False");
}
if (trigger == true) {
GUI.Label (new Rect (20, 60, 100, 30), "True");
}
}
I have no idea why the trigger function hates me as I looked through a lot of other solutions and none have worked. At this point I am out of ideas why it’s not working.