Navigation Node not creating a path who avoid static bodies

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bluecatgames

Hi Guys!

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:

func return_Initial_pos(delta):
    if navigation_agent.is_navigation_finished():
        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
    look_at(target_position, Vector3.UP)

Here the main scene tree:

Here the enemy tree:

:bust_in_silhouette: Reply From: LordBoots

Try connecting the signal:

func _on_agent_velocity_computed(safe_velocity): velocity = move_and_slide_with_snap(safe_velocity, Vector3.DOWN, Vector3.UP, true)