Instantiating and destroying a lot of items (such as bullets or enemies) is inefficient and can slow down your projects. A professional way of handling this issue is by using a technique known as object pooling.
Pooly is a professional pooling system that gives you all the tools you need in order to implement and manage the spawning and despawning of a lot of objects at once.
The system is easy to understand and quick to integrate, allowing you to configure how objects are pooled, how they are spawned and how they get despawned.
This All-In-One pool management system allows you to create scene-based pools, comes with a multipurpose object despawner and also with an intelligent object spawning system. All the components have clean custom inspectors that will help you configure them in just a few clicks.
Pooly works in 2D and 3D space, being optimized for all the mobile platforms.
As game devs ourselves, we are dedicated to continually improving and expanding our assets, based on everyone’s feedback, and also providing top-notch support.
Hi there, is it possible to get access to the last particle I spawned through code? I’d like to set some parameters to the particle effect I’m spawning.
For example, how could I reference the particle I spawn by doing this:
Pooly.Spawn(attackObject.GetSFSObject("particles").GetUtfString("hit"), child.transform.position + new Vector3(0, 0.5f, 0), new Vector3(0, 0, 0), gameParticles.transform);
Hi there, is it possible to get access to the last particle I spawned through code?
Sure you can. Pooly.Spawn returns a Transform of the clone you instantiated. Just get a reference to it by doing this:
Transform lastParticleSpawned = Pooly.Spawn(attackObject.GetSFSObject("particles").GetUtfString("hit"), child.transform.position + new Vector3(0, 0.5f, 0), new Vector3(0, 0, 0), gameParticles.transform);
Then all you have to do is:
lastParticleSpawned.GetComponent<ParticleSystem>(); //change the particle system setting here
is it possible to adjust the Random Spawn Interval Times over time? For example if I had a spawner firing missiles at the player and I wanted to increase the difficulty level/amount of missiles over time.
I use Playmaker so it would be ideal to control it via PM.
We designed the Spawners as a pre-defined custom spawning solution. That is why, at the moment, it is not possible to have the Spawner’s parameters change automatically over time or via PM.
What you could do, in described scenario, is the following:
Have Spawners with different pre-defined settings made into prefabs and then pooled inside of Pooly.
Set the Spawners “Auto Start On” to “On Spawned” - the spawners will automatically start their normal routines when they are spawned themselves
Spawn/despawn your Spawners, as needed, using the PlayMaker actions for Pooly
Thanks for getting back to me. That solution could work but I think in my situation creating prefabs and spawning spawners might be overkill. As I can’t change the settings I think I’ll just set up two or three identical spawners (easy, medium and hard) with different random interval times and just stop and start them as required.
Thanks again for Pooly, it really has made a big part of my game so much easier to create.
Top notch stuff. I highly recommend pooly for your playmaker project. I actually made a tutorial video on how I setup my spawners, despawners, etc for pooly in playmaker. Its a bit long, everything from zero
Your video shows a solid approach to using Pooly with PlayMaker and the information is very useful and well structured!
One small observation, for the sake of efficiency: at ~27 minutes - you don’t really need to send the spawned clone a reference to itself; you can just use the GetParent action on the clone to get a reference for despawning itself.
However it is, indeed, a very good example on how to pass around the reference to the spawned GO.
Hi Alex and everyone else, just a quick post to let you all know my new game for iOS is out. It’s called Tower Blast! and is a fun little arcade game with a similar feel to Missile Command. If you get a chance you can download it here: https://goo.gl/uU986A
It uses Pooly extensively, so much so that I’ve even given EZ a thank you in the credits. It was used for pooling and spawning the missiles, explosions and power ups. For me the best part of Pooly was the ease of setting up spawners. They’re an integral part of my game and I think Pooly along with its Playmaker actions probably saved me days of work.