Hi,
I’m trying to have an tree grow, until you cut it down for wood.
I have a button (ButtonCreateTree) that instantiates a prefab.
When this prefab is instantiated, a counter starts.
When the counter reaches 30, a button is instantiated (CutTreeButton).
When you click the button, the prefab is destroyed.
I also want another variable, (count).
When I press the ButtonCreateTree the count goes +1, when I press CutTreeButton, the count goes -1.
The only problem is I don’t know where to instantiate the variable in order to be able to access it from both buttons, and modify it.You can take a look at my graph:
Thanks!