I was trying to debug my code where some units could move and attack because with around 60-70 units it started to run at a very lwo framerate.
Sadly, I commented out most of my code and discovered that it was still running very slow with only the movement inside the units physics process.
To make you understand better, here is the code and the profiler:
if isMoving: # always true, since I commented the part of the code that could set it to false
var vector = ( self.destination - .get_global_position()).normalized()
myUnitBody.move_and_slide(vector * movementSpeed)
I was not able to understand why, with just that code and 60-70 nodes, I get this huge frames drop while I've read of people that manage to fit 500+ units without any issue.
Thank you in advance.