Does anyone know how to make coins able to buy stuff? Also can someone help me make it so when I get the coin, and then I die, I don’t get the coins until the next level? or instead, maybe just delete the coins collected, so I can’t collect them again?
When you hit a coin have it add a number to a save function. Btw there’s an example game of this.
Do you mean make it add a coin to something? I already did that.
This is my game.
I think instead of incrementing both the number and the global variable you should just increment the number then set the global variable to that number. Or maybe just use only the global variable instead of a number. Then you can change this global variable in other objects to buy things.
how would I do that? sorry I’m kinda new to this
The number called coins, put the global variable there instead of the number. Then just increment the global variable
Ok do I get rid of the other global variable?
Yeah, you only need one global variable for this.
I did that but now it isn’t adding a coin.
It seems you forgot to connect it to the + node and only connected it to the get node
what does node mean?
ok I fixed and now the coins reset when you die, but when you get another coin it goes back to what coins you got before you died.
a node is the point which gets connected to other blocks
When you die you need to set the global variable to zero
btw, according to the heading at the top of the page, welcome back!
It still isn’t working, now it resets the number to 0 and when I get another coin it goes back to the number you had before
@mmat7238
this should fix it if you follow the steps exactly
This goes inside your COIN object (The global is a number named Coins)
This will go inside your player (character) object
On your player & coins set them both to Keep on level restart
Player:
Coins:
will be in the exact same spot.
Please let me know if you need anything else & feel free to ping me!: @Death68093