Aaargh. I’m having problems with what (seems to me) to be a simple thing.
I’ve got an animated object (animated in Maya), that moves through the scene. I’d like to have it so that as this moving object runs into triggers, it triggers events (animation, audio cues, etc…).
I’ve made a cube to act as the trigger (Is Trigger is checked within its Box Collider). The script below is attached to it:
var soldierDavis: GameObject;
function onTriggerEnter (other : Collider) {
if (other.gameObject.tag == "HotCar") //
{
print("I've been triggered");
soldierDavis.animation.CrossFade ("walk");
}
}
The object that is animated is tagged as “HotCar” and also has a Box Collider. But as HotCar moves through the trigger, it never triggers. What in the world am I doing wrong?
Thanks!