So does anyone know how to an enemy ai look down the path it's travelling on in 3d?

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

Even though I can get my enemy character to look at the player’s character while moving down it’s path towards the player, I don’t know how to make the enemy look down the path it’s traveling; this has weird implications for how my enemy looks when animated in the level.
Here is a piece of what my pathfinding cod looks like.

if path_node < path.size():
    var dir_on_path = (path[path_node] - global_transform.origin)
    if dir_on_path.length() < 1 and entered_area == false:
            path_node += 1
    elif state == CHASE:
        focus_on(target,50);anim_player.play("run")
        move_and_slide(dir_on_path.normalized() * speed, Vector3.UP)

The focus_on function I’ve created helps the enemy to look at the player character while moving down the path toward the player character. However, the enemy isn’t looking down the path it’s travelling on, that can be a problem as the enemy shouldn’t always be facing the enemy when moving down this path. Sometimes the path to the player isn’t always putting directly at the player. Can anybody help me?