Hey guys, I have a game clock and every X amount of time, random items spawn.
I would like to limit the amount of spawned items but I am not sure how to do so. I have been messing around with variables that don’t seem to work exactly how I want it to.
I think I need to use the Clamp method, but am not sure how to do it.
Essentially, I want to spawn a bunch of the same pickup, randomly on the screen. However if the player isn’t picking up anything, I don’t want the game to keep spawning and spawning. Is there a way I can track how many entities are spawned within the code? Outside of the console of course.