79664093

Date: 2025-06-12 20:50:35
Score: 0.5
Natty:
Report link

One thing that you probably need to do is to space out and stagger your pathfinding. Your agents likely do not need to recalculate the path every frame. If you're not ready to make a jump to DOTS and/or threading, you can still use coroutines on your agents to have them only recalculate the path every X milliseconds. And once you do that, I highly recommend to add a random factor so that they're not all recalculating on the same frame. If you forget to add that staggering, you will instead see periodic spikes in your profiler, possibly paired with stutters in the game, as every agent hits the recalculate together.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Single line (0.5):
Posted by: Sean Duggan