☆
2
NavigationAgent2D recalculates the path every frame
My enemies call get_next_path_position every frame and I also set target_position every frame. Profiler shows pathfinding as a hot spot.
Sphere
My enemies call get_next_path_position every frame and I also set target_position every frame. Profiler shows pathfinding as a hot spot.
Add a replan interval, for example every 0.3 seconds, and set path_desired_distance so they do not repath at every tiny movement. Also check collision layers on the navigation region.
3 replies