So what I’m trying to do is: I want the player do be able to upgrade the damage he deals to enemies. For that I use a public float damage. In another script. When the player clicks on a button, the following executes:
public void Damage()
{
damage += 5f;
print(damage);
Resume();
}
Resume just makes the game go on but the problem is, that this value is stored in another script and seems to update (add +5) in this script but not in the other one, where the value is stored.
Thanks in advance for any help.
- Please use CODE-tags.
- You’ll need a reference to that other script. Then, as long as the damage-variable is public, you can do
otherScript.damage += 5f;
Thank you so much!