Lag spike when spawn enemies

bitmore

Member
Hi,
I'm using third party PoolKit to spawn about 20 enemies, They were spawned one by one per second.
Every time one enemy was spawned, there will be obvious lag spike.
I also tried remove the Behavior Tree on the enemies, but the lag still.
Any suggestions how to fix this? I'm working on UCC 2.3.5 + UIS 1.1.8.
Thanks.
lag.jpg
 
@Justin Tagging you in this just in case I miss something, because I don't have access to the ObjectPool source code, but my understanding is that spawning an entire UCC character will inevitably cause a substantial amount of GC?
 
It looks like your bottleneck is within Awake so if you pool your agents during the loading screen when they are enabled again it'll be quick because Awake isn't called. Awake is responsible for deserializing all of the abilities so it makes sense that it is slower.
 
Top