|
Post by citizen12 on Jul 19, 2018 18:06:03 GMT
I want to recycle objects in my object pools, but PoolBoss doesn't seem to support that by default. Specifically, I want to have my spawners spawn one or two objects at a time and run for an unlimited amount of time. GameKit/PoolBoss SHOULD support that but it doesn't seem to behave as I would expect.
As you can see in this video, I have 2 spawners that are set to continually spawn objects. Each prefab pool is set to only have a max of 5 objects and additional instantiation disabled. After the initial objects are spawned, I use the PoolBoss runtime UI to kill all the red objects. They then respawn IN THE SAME LOCATION WHERE THEY WERE KILLED. I expected them to reset their position and spawn from the red spawner as they did initially.
I imagine I can handle this on my own by attaching a despawn event handler to my red prefabs to reset their state, but first I want to make sure I'm not missing something about how PoolBoss works.
Am I missing something?
|
|
|
Post by DarkTonic Dev on Jul 19, 2018 19:45:19 GMT
Despawning things just makes them disabled, it does nothing with position or state of the prefab instances. Spawners however have controls on where to spawn things and will not care if the things have been spawned before. It will just work.
Are they being respawned by the spawners? Or is it some Killable Respawn setting thing that is respawning them?
|
|
|
Post by citizen12 on Jul 19, 2018 21:16:43 GMT
Despawning things just makes them disabled, it does nothing with position or state of the prefab instances. Spawners however have controls on where to spawn things and will not care if the things have been spawned before. It will just work. Are they being respawned by the spawners? Or is it some Killable Respawn setting thing that is respawning them? They're just being respawned by the spawners. I'm just using the Triggered Spawner v2 script:  
|
|
|
Post by DarkTonic Dev on Jul 19, 2018 23:03:07 GMT
And how do you know this? Are you disabling and re-enabling the object so "Enabled" will fire a new wave?
|
|
|
Post by citizen12 on Jul 20, 2018 4:08:29 GMT
And how do you know this? Are you disabling and re-enabling the object so "Enabled" will fire a new wave? I figured out the problem. My prototype object had a Killable attached, but the rigidbody and collider were on a child object with a cube mesh and renderer. So, what was happening was that Pool Boss was, in fact, working correctly by respawning my prefab at the location of the spawner, but it wasn't doing anything for the child rigidbodies (which had moved in the scene due to physics). I had thought the Killable Child components I had placed on the child objects would make Pool Boss more aware of them, but in thinking about it what I really want is for the top level prefab object to be moving in the scene, anyway, rather than the child objects. Long story short is now that I understand how Core GameKit is managing these objects, it behaves as expected. Thanks.
|
|
|
Post by DarkTonic Dev on Jul 20, 2018 15:25:00 GMT
Ok
|
|