Post by thelyricalnub on Dec 14, 2023 21:25:59 GMT
Hello! So I have a weird one, that I can't seem to figure out.
First off, great asset! Gave me the performance boost I needed in my mobile game. Thank you!
So I read over the documentation, got it imported and setup. And it works flawless until the game has been running for around 4-5 minutes. Then I start getting "you should never destroy the prefabs pool boss uses" error, and all the pooled prefabs are gone. So of course, I went through the stack trace. I put in break points, setup some "Checked OnDisable" functons with a watchlist defined by Hashset, to catch the code that is calling "Destroy". (Very useful script, and I'll post it, if anyone wants it) ... but alas, the script didn't find it, so I went line by line, script by script, and again, found nothing. So unless I am a complete idiot(very possible), nothing is calling destroy, yet the prefabs vanish. I am at a loss. Like I said, it's just weird. If it helps, Pool Boss spawns and despawns without error at first and never peaks close to the pool size I have set, I have it set to "recycle" pooled items, and to "add missing", load in is set to 300 frames, and total pooled items is 600 in scene, however only 20-40 are used at any given time. Having them all already instantiated and ready to go, helps a ton, because what gets spawned is completely randomized.
It is entirely possible, and probably most likely that this is not a Pool Boss problem, and the issue is some Unity bug, however I wanted to cover all the possibilities, so I figued I would ask if anyone has any ideas? I'm in 2022.3.14f1.
************
Edit
************
Ok, so I figured it out! And to the mod, thank you for responding so quickly!! I thought I would come back and post what I found, in case anyone runs across this issue. So here it goes..
-- First please note that this is only tested on Unity 2022.3.14f1 free edition. And most importantly, it is unclear if this is a Pool Boss bug, or a Unity bug, or just me missing a note in the documentation. This is posted as debug help and general info only. This is not a complaint or review.
(I'm new to this whole forum thing.... sorry just covering my tail)
In my instance, I have Pool Boss spawning projectiles, hit effects, destruction effects, etc. As stated above, I got the error for "don't destroy prefabs that pool boss uses". Well the error was being thrown any time the "DeSpawn" function was called from a GameObject that was not the GameObject that called the "SpawnOutsideOfPool" function for that particular prefab. For example: If "Missle A" was spawned by script A on GameObject A, but then DeSpawned from Script B on GameObject B, the error would throw and the prefab vanish from avalible prefabs in the pool. This occured with Despawn functions on both Base and Sub Classes (uncertain if that even matters), and the 3-4 minute delay that I mentioned above was caused by my game flow. For example: When the spawned prefab hit it's intended target, it would be despawned from the class it originated and no problems. However if it was despawned from the "KillBox" that I had setup to catch whatever might end up off camera, or if despawned by the "IfInvisable" function, that's when it started happening.
To fix, i simply altered the code so that whatever object or class spawned the prefab, also was called to despawn it. And viola. Error is gone, game runs awesome, and I have updated my internal testers with the updated version!
--- To be clear - Unity is a fickle mistress, and I am no expert. I am a retired audio engineer that took up game dev to make cool stuff and maybe some spare change along the way. All of this could in fact completely be my mistake, and probably is. But I felt it could maybe help some one, so here it is! To the asset developer or dev team, a big thanks because this asset cured all my performance issues, and I'll be leaving a review on the asset store about how incredible this asset has helped my game. Great work!
--- Side Note For devs : Is there a more detailed description of your audio plugin I could take a look at? I am considering getting the AAA one you offer as it kinda looks like it creates a DAW inside of Unity. I've been going insane flipping between Unity and ProTools, and sometimes even Reaper. And would love to have that functionality in Unity. Just curious about stuff like: VSTs? built in editing tools? razor edits? bit rate? samples? etc... Thank you again for everything! Cheers!
-David