Coding 1 time events with OnTrigger/OnCollision

How would I code a one time event on a Collision/COllider?

Simply whent he player is in the wrong trigger, or colliding with an enemy I’d like him to loose a life, then respawn at a set location. (Don’t worry respawn location is all done) What I;m strugglingw ith is loosing a life, well loosing jyst one life.

A quick cut of the code I’m working with, I know it’s simple, maybe addin an if statemnet wtihin the code? to check if a life has been taken? Not entirely sure.

function OnCollisionStay(collision : Collision) {

  	if(collision.gameObject.tag == "rollingball2"){
  			lifecapsules -=1;

Thanks, BobbleHead

Just use OnCollisionEnter() instead that OnCollisionStay(). The former executes his body just once, while the latter executes it every frame, until the collision remains verified.