Health system in a text based game.

Hi, I don’t understand why but when I take damage, it constantly drops down.

This is my damage method

	public void damagePlayer(int amount) {

		GameObject.Find ("PlayerCondition").GetComponent<PlayerCondition> ().playerHealth = GameObject.Find("PlayerCondition").GetComponent<PlayerCondition>().playerHealth - amount ;

	}

(It’s pretty basic, I’m a begginer here :3 )

and this is my test method.

	void State_ReputationTest1 () {

		if (GameObject.Find ("PlayerCondition").GetComponent<PlayerCondition> ().playerReputation <= 5)
			text.text = "This person hates you";
		else if (GameObject.Find ("PlayerCondition").GetComponent<PlayerCondition> ().playerReputation > 5) 
			damagePlayer(1) ;
			text.text = "This person likes you";


		}

^^^^^^^^^^^ this is a test.

thanks for the attention, guys!

Anyone knows what’s up?

It’s because you’re running the function in the update. So it’s continuously running the subtraction. I’m currently having the same trouble and researching how to get around this problem. @xavier12312