Have Actor Spawn Every 2 Seconds When Inside
JoshKahane
Member Posts: 470
Hi
I am having troubles creating an actor that spawns every 2 seconds when your touching inside an actor. This is so that performance isn't hit so badly, I don't want the player to be able to rapidly tap the screen and tons spawn, I only want it to be able to spawn every 2 seconds.
Hope you can help, thanks.
I am having troubles creating an actor that spawns every 2 seconds when your touching inside an actor. This is so that performance isn't hit so badly, I don't want the player to be able to rapidly tap the screen and tons spawn, I only want it to be able to spawn every 2 seconds.
Hope you can help, thanks.
Comments
A timer that runs every two seconds and if the fire button/touch is pressed/present, spawn a new one.
A boolean attribute that gets set to "true" when an item is spawned. Then a timer is kicked off and after two seconds sets the attribute back to "false" to signify another spawn can be done.
The spawned actor could also kill itself off after the two seconds if you want to limit the count of the on-screen spawned actor.
As with most other logic and programming-esque tasks, there is likely a handful of other ways to handle this.
See if some of the shooter demo implement this...