many enemies on screen

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Angelo

Hello! I have a player with simple movement and I’m instantiating several enemies around the player. The only thing the enemy does is walk towards the player. When there are around 800 enemies on the map the FPS drops to close to 4.

Any optimization tips? I’ll post the images with the nodes and codes here.

Thank You.

:bust_in_silhouette: Reply From: Gluon

There are some tips in the official docs here

but honestly 800 sprites each working with independent scripts is a lot to have on screen at one time. I dont know what your game is but you could maybe have batches of 10 sprites created all working as one unit so there is only one script to run each time but all 10 move the same way with that one script or something similar to that maybe?