- Home /
Question by
Gameeeee24 · Dec 05, 2017 at 06:09 PM ·
scripting problem2d gamescriptingbasicsbegginer
Hello guys i am new in unity and i have problem can anyone give me some idea
What i am doing is revive button when the user press the revive button it gets minus to the coin on how much is the revive button. The problem is he can revive anytime what ever he wants to and he's coin is gets minus. What i am trying to do is if the player coin is not enough to revive button , it cannot be click and not working , he needs 20 coin for example to revive this is my code, and i don't know how to make the button disable when the coin is not enough to revive
private void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.tag == "Player") {
PlayerManager.health -= 0;
Destroy(col.gameObject);
menuContainer.SetActive(true);
}
Comment