Trigger doesnt do Speed Booster

Hi everyone, i want that my ball get a speed booster when it crosses an object. For that i did this Script, but when the ball cross the box nothing happens. The box has rigidbody and default box collider. I probe with trigger off and trigger on. And i dont know how to do. Any idea? Thanks.

var ballForce:uint = 40;

function OnTriggerEnter(other:Collider)
{
	if(other.gameObject.tag == "Ball")
	{
			var pelota:GameObject = other.gameObject;
			pelota.rigidbody.AddForce(0,0, (-1)*ballForce);
	}
}

Hey AnxoDL, I used your script in my project and it worked. Here is what I did:

Change line 8 from:

pelota.rigidbody.AddForce(0,0, (-1)*ballForce);

To:

pelota.rigidbody.AddForce(-Vector3.forward*ballForce);

Now keep in mind, I’m assuming that your “AddForce(0, 0, (-1)*ballForce)” means you want the object to move back on the “Negative of the z-axis” upon impact with the trigger. If not change the keyword “-Vector3.forward” to the direction you want. If you need to know more, here is a link to the documentation on how to use Vector3 in AddForce:

Also note 40, as an interger for how fast you move, is pretty small. I had to raise the number from 40 to 400 to see a difference. If you have any questions just comment on this. If this fixed your problem, please mark it as solved so others may see it, and ask there own questions to grow the Unity community.