Q:

Using triggers attached to enemy to make enemy jump in a 2.5d platformer

so I've got an enemy in my 2.5d platformer, that I already got to follow the player around, now I want him to jump over small obstacles, and honestly, I have no idea how to.  My enemy is a sphere with rigidbody and a box collider scaled 2x in X axis, effectively making it 2 times wider than the sphere.  I want this box collider to be a trigger and for it to launch a AddForce. 
Where do I put the code for the trigger - if I put it in void update() wouldn't it apply force until the sphere is above the obstacle?  I only want it to apply the force once. 
Also, what would the code for the trigger look like? 
So far I only got figured out how to find the rigidbody by getcomponent and apply force to it, and I watched a video on triggers, but it didn't really help :/  

A:

Use OnTriggerEnter method like this:
void OnTriggerEnter(Collider other) 
{
    if (other.tag == "IMakeEnemyJumpBeforeAnObstacle")
    {
        // add force here
    }
}

Note: this code should be in your enemy script.  Plus use IMakeEnemyJumpBeforeAnObstacle tag on the trigger object which will be placed right before the obstacle.  And make sure both the enemy and the other object have property IsTrigger checked from inspector. 
Learn More
Hope this helps

