Counts items in the scene
Is there a way to count all the coins I have in the scene with logic?
-
you can have a variable 'HowManyCoins' which you set to the number of coins you put in the scene.
When the user picks up a coin, you have some logic on the coin to detect when it is picked up, and then you destroy it etc? To that logic add a variable modifier that reduces 'HowManyCoins' by 1 just before it gets destroyed
If you mean automatically, then I don't think so. -
Hi,
On a trigger zone there is an output called "number detected" you can use this as well as changing the trigger zone to detect "scene" on the zone size page.
John -
Thank you! ?
Even if I found another way to do it, "the number detected" on the trigger zone was much easier. ? -
Is this a solid way to have eg ‘collect x coins’ and the trigger something when the number gets to 0 - I was thinking you’d use a variable but then you’d have to update that every time you want to add some objects. This approach sounds like you would be free to add some objects and the logic would update automatically
Please sign in to leave a comment.