- Home /
Simple Triggers problem.
This seems to be a painfully simple question. I've reduced my setup as much as possible, but still have the issue. I have a cube with a box collider + a rigid body (not kinematic) and another cube with a box collider which is a trigger (not kinematic.) I hit play in Unity then manually collide the obj with the collider into the box with the trigger. No event seems to be fired. The following code is attached to the object with the collider. "Awake" is the only message I see.
function Awake() { Debug.Log("Awake!"); }
function OnTriggerEnter(other:Collider) { Debug.Log("Triggered"); }
function OnTriggerExit(other:Collider) { Debug.Log("Exited"); }
function OnTriggerStay(other:Collider) { Debug.Log("Stayed"); }
I can get the setup working just fine if I start a new project. I'm not sure what I've done wrong here which prevents the events from being fired. Much thanks for any help.
p.s. I've deleted the project till there were only two cubes left, and still had the problem. I've created a new project with two cubes and the problem was gone. I can probably just transfer everything over, but I'd like to understand what went wrong.
Transferring all scripts to a new project seemed to fix the problem, which persisted even when all scripts but the basic test script were deleted from the old project.
Answer by Jibidiah · Sep 13, 2011 at 03:20 AM
are there any other scripts in your current project that might be interfering with it? If you can start a new project and have this fine work in the new project then that could be a reason.
I'm no expert at unity, just thought I'd try to help.