Object hugs walls constantly when moving, how do I avoid this

the object that is finding it’s way to the player is almost constantly wall-hugging and I was wondering if there’s a way to fix this


The wall hugging is a consequence of that the shortest path is always found. You can improve the look by adding a greater margin from walls to the first valid nodes in the graph (e.g Grid Graph -> Collision Settings -> Diameter). Or you could try the SimpleSmooth modifier with the Offset Simple option (or perhaps bezier).
A more advanced approach would be do to raycasts from the unit and try to not stay as close to walls while still staying on the path.