My game has been coded so that when my ball reaches a capsule whose **isTrigger** property is checked, and is tagged **Collectible** the ball will fly upwards 100.0f.
void onTriggerEnter(Collider other)
{
if(other.gameObject.tag=="Collectible")
{
rigidbody.AddForce(0.0f,100.0f,0.0f);
}
}
However, when I tested it, the ball just passed through the capsule as if the code had no effect at all.
Help please?
↧