Freeze problem with asset spawner Oo

Hello all!

Freeze problem when several simple assets appear by asset spawner with behavior projectil :frowning:
I installed 16 cannons on a parkour which fire a projectile (8 every 3 seconds and 8 every 4 seconds). The projectiles arrive via asset spawner with a timer event, these assets are very small with only 6 faces…
Do you also have this problem? Is there a way to avoid this (very short) freeze while keeping these 16 cannons?

2 Likes

Triggering many spawners at the same time causing lag to spikes/freeze you’re mentioning?
Try pressing F11 and using a profiler to confirm this.

If yes, what you can do to optimize

  • Reducing the spawner count
  • OR avoid triggering too many of them at the same time
  • OR find other more optimized way to do it.

From your post, I assume the cannon shooting non-stop every few seconds.
How about consider to only activating the spawner when a player enters the range, turn them off when player exit, by using Trigger Volume and Toggle Component.

Another solution
If your canon direction is fixed, what I would consider is assign the Projectile along with Health component. When the projectile collides, send a message to self to kill with the health. When you set the Death event to ‘Reset’. It will reset its position and repeat the shooting without using the Asset Spawner.

projectile with health

6 Likes

Super tips! Thank you Meowl :slight_smile:

3 Likes