The character and the walls overlapse when it follows a path

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

I am new at godot. I am making a 2d game and I want the enemy to follow the player and if there is a wall between them it shuold go around the wall.
So, I used Navigation2D node with tile map. I watched some videos and copied some codes and it works fine.
The problem is that, the Navigation2D node creates a simple path, but this path is for dots, not for rects. My enemy is not a dot, it is a rectangle, and its center point follows the path. Therefore, while it goes through the corner of the wall, it looks like it is inside of the wall.
Is there any way to aviod this? How can the enemy collide with walls while it follows a path or how can we change the points of the path?

:bust_in_silhouette: Reply From: MarshaLee

Maybe you could had a problem with your collision layers?. Maybe trying make your collision shapes bigger.

Maybe you can change the node, if you’re using an area2d, maybe change it to a Ridigbody, kinematicbody, or implement collision on your code