I make games carnaval and I have a little issue with the trigger, the game throwing the ball into the box ,inside the box i put collider with a trigger on, when the object collide with the ball tag “BALL” (goal) and another game object called “clown” Play animation from “idle” to “celebrate”. but when the ball collide with the trigger animation “celebration” does not start … i used this script…
var other : gameObject ; // clown
function OnTriggerEnter (collision : Collider)
{
if ((collision.gameObject.tag == "BALL") )
{
other.animation.Play ("celebrate");
}
}
var other : Animation ; // assign the game object having the animation BOX OR BALL
function OnTriggerEnter (collision : Collider)
{
if ((collision.gameObject.tag == "BOX") )//here put the the tag for the game object box where you want to hit the ball
{
other.Play("celebrate");
}
}
put this script to the ball and add character controller or a rigid body to detect the collision to the BALL and inside the BOX where you want to hit put box collider with trigger on if any doubt ask in comments