How do I check to see if I have coins before I spawn an object? Also, I have a timer adding coins every 30 seconds how do I only add coins if the player has less than 20? And, How do I simply display the timer on the screen?
I have my timer figured out but I still have no clue how to programmatically check if my player has coins. Can this be done?
If you add this inside script node: Code: function signal(name, value){ if(name == 'Enabled' && value && this.scene().currentCoins() < 20){ this.emitSignal('spawn', true); } } And connect timer node (value can be 1) and connect it with script node, it checks every second coins count. If there are less than 20 coins, it sends out signal. Script input name is "Enabled" and output name is "spawn". And you can connect it with your 30 second timer node (disconnect from start node). Haven't tested this code, but it should work.
Thank you this will at least give me some direction even if the code doesn't work. I will check it out when I get home this evening.
Is the referenced in any documentation? Please link if it is. I wonder what else I can learn from that if it exists.
@Hanomax can you make some asset to help as all with this pls. I think this can solve my problem of coins going negative.