|
I have chests that open and give me money. When I open the first chest it gives me 500, but when I open a second chest it is adding the new amount to the original money amount of 0 and I am still left with 500. here is my code please help:
(comments are locked)
|
|
You need to store "money" and "moneyAmount" in different scripts (or instances) because at the moment each script is updating its own money amount which will always be 0. Store the player's money on the player object or a game controller object separate from the pickups. e.g. money script:
player script:
(comments are locked)
|
