I need a help with the new pathfinding system implemented in godot 3.5.1 , it seems not creating a path who avoid static bodies, look the video above:
Path Problem error video
When the enemy needs to return the initial position, the path is not drawed and the enemy stucks in the wall.
It seems are drawing a direct line path and not one who avoid the wall.
Here is the code:
return_finished = true
destination = global_translation.direction_to(navigation_agent.get_final_location())
destination.y = 0
var desired_velocity = destination * 20
var steering = (desired_velocity - velocity) * delta * 4.0
velocity += steering
velocity = move_and_slide(velocity)
var target_position = navigation_agent.get_target_location()
target_position.y = self.transform.origin.y
Here the main scene tree:
Here the enemy tree: