|
Post by D on Nov 23, 2016 1:27:48 GMT
Hi,
I'm using this line of code to despawn my enemies when they get killed:
PoolBoss.Despawn(this.transform);
the code does work, the gameobject is set deactive but the poolboss is not re-using them, i get an error:
has no available clones left to Spawn in Pool Boss. Please increase your Preload Qty, turn on Allow Instantiate More or turn on Recycle Oldest (Recycle is only for non-essential things like decals).
since i spawn this prefab thousands of times across the game i need the poolboss to re-use the despawned prefabs offcourse.
How can i achieve this?
I do not use any killable script or anything just the spawners and poolboss.
|
|
|
Post by DarkTonic Dev on Nov 23, 2016 3:18:47 GMT
Well what you describe is entirely normal usage. If you're positive that there are unused deactivated clones of that prefab under Pool Boss in the Hierarchy, then that's a bug but I can't reproduce it. If so, you will need to send me an example project that reproduces the bug so I can check it out and fix it.
Alternatively, maybe you just haven't set Preload Qty high enough and you're already using all the clones. If so, you just need to do what the warning says and increase the Preload Qty field for that particular prefab, or turn on Allow Instantiate More for the item (worse performance).
What scripts you are using does not matter at all.
|
|
|
Post by starfoxy on Feb 9, 2017 8:12:22 GMT
I was going to post in a new thread but I came across this one.
I am getting the exact same behaviour and I've tried both ways - both with a killable script attached (to despawn on not visible) and programmatically.
Everything appears to be set up properly. I watch the pool and it spawns/despawns for the first bit and then just says:
The Transform 'bullet' has no available clones left to Spawn in Pool Boss. Please increase your Preload Qty, turn on Allow Instantiate More or turn on Recycle Oldest (Recycle is only for non-essential things like decals).
And I really have trouble believing that this is a bug, it seems like a pretty basic thing to be doing so maybe I am doing something wrong. Would it throw this error and not try to spawn/despawn anymore after it's thrown? I should be able to set the maximum pool qty to any number high or low, no?
So I've done some additional testing...
I set my pool preload qty to 10.
I fire the bullet once. It spawns and then despawns.
I can do this 10 times and it works as it should.
Anything over that and it just spawns and never despawns and eventually - after 10 times of spawning, I get the error above.
|
|
|
Post by DarkTonic Dev on Feb 9, 2017 17:48:43 GMT
I would believe that you are destroying the prefab instead of despawning it, perhaps unintentionally, if this is happening. What does the Pool Boss Inspector show at that time? Either they are not despawned or they are destroyed. Show me a screen shot of your Hierarchy as well, showing the clones of that prefab under Pool Boss.
As I said, I can't reproduce what you're seeing. Can you send me a Scene if you're still stuck?
|
|
|
Post by starfoxy on Feb 9, 2017 20:44:17 GMT
Hi there, I am not destroying them as I know that's the whole point of a pool. They are being despawned and actually do so for the first (in this case, 10). The hierarchy does show the 10 that I have in the pool and I will send a screenshot. I can send you my project file as well. It's all very odd as I never had this issue (a while back) with the standalone Pool Boss. As you mentioned however, something else must be going on. I have your email from a while back, can I send you a link via that? cheers!
|
|
|
Despawn
Feb 9, 2017 22:47:12 GMT
via mobile
Post by DarkTonic Dev on Feb 9, 2017 22:47:12 GMT
Yes or PM me here.
|
|