Player goes down all the time after triggerenter

Hey guys,

I have a small problem were my player goes down for all eternity on a ontriggerenter. I want the player to only go down by one step of 10 instead of repeating this for the whole time!

This is the code that I used:

 void OnTriggerEnter(Collider other) {
            if (other.gameObject.tag == "Player") {
                PlayerController.player.velocity = new Vector3(PlayerController.player.velocity.x, -10);
    
            }

Help would be really appreciated.

With kind regards,
Zico

So you want to adjust the player’s position, not their velocity:

PlayerController.player.transform.position += Vector3.down * 10;