Is there a way to slow down object pooling?

Hello everyone! I am remixing a version of Galaga for my final project in school but when using an object pooling system to create the enemies, it does it way too fast and I was wondering if there was a way to slow it down enough for the player to shoot at the ship. I’ve tried invoke but it doesn’t work since the spawning function takes attributes. Also, the game objects that are disabled still shoot at the player, so is there a check that I can create to see if the object is enabled? Any help would be appreciated, thank you!

This is kind of confusing. Pooling just holds on to a number of inactive objects to reduce cost of creating / destroying objects. It doesn’t have any intrinsic “speed” itself, it’s the frequency / number of calls to pool methods in your own code that affects how often things get taken or put back in the pool.

Showing code that you think is problematic is a good start that will help make this more clear.

3 Likes

Pooling has a specific technical meaning.

I suspect you perhaps mean the spaceships joining the formation is what you are calling “pooling?”

That is not pooling, that is simply enemy behaviour.

If you need to learn how to move things around, use a free tweener or else work through tutorials until you build up a mental toolkit of how to move things over time or along paths.

Otherwise, pooling should have NOTHING to do with timing, as SpyMaster points out.

I’m sorry I wasn’t clear but I was able to figure it out, the video I watched put the code in the fixedUpdate function but I forgot I could’ve called it in a different way to slow down the spawning. Thank you all for your help!

1 Like