My project is a 2d topdown game with a lot of enemies, and my move function that uses getsimplepath and tile navigation is consuming a lot of performance.
Here is my code:
var point = 0
target = navigation.get_simple_path(global_position,GameManager.playerNode.global_position,false)
if global_position == target[point]:
point += 1
motion = (target[point] - position).normalized() * moveSpeed
This function is running on physicsproccess(delta)