Hello there, I’m trying to work on shotgun mechanic where I spawn ~100 projectiles all at once, and I’m looking for some ideas on performance. Until now I’ve just been spawning the one projectile but now, I’m spawning anywhere between 1 and 100. I’ve changed my code to spawn 100 at once, and it seems like I’m having some problems. First of all, whenever I spawn 100 actors it stutters for a second. I’m guessing that’s because it doesn’t have the chance to finish the tick function. Second of all, when I replicate this it seems to cause some serious network lag. This is not entirely surprising, that’s a lot to replicate all at once.
I’ve tried a couple things. I’ve tried separating them out into components. The problem is that I have properties in blueprint, which can’t be determined in the constructor to initialize the components! I’ve tried disabling replication and spawning client/server versions. I’m not fond of this idea, and it did sort of work, but it still causes a huge hiccup when they all spawn at once.
I’m looking for some idea as to how I can possible to it so that they spawn without the crazy lag. Any help is appreciated. Thank you!