Is there any way to patrol an enemy only in road using navigation 2D?

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

I just want to build an Enemy AI that has patrolling in the road that build in tile map.
Is there anyway to use navigation2D to get what I desired to this in this tank. I am newbie

:bust_in_silhouette: Reply From: Gangster53 YT

Maybe there is a way to do this without using the “Navigation2D” node.

If it will follow you when you approach the enemy:
-Maybe you can add the enemy to a “Path2D” node and remove the enemy from the “Path2D” node when they enter the enemy’s area.

I opened a trial project. I think he’ll manage. You can change this: