Nav Mesh Agent destination not lining up with actual target.

I’ve recently converted my movement script for NPC’s in my game from manually moving their rigidbodys to letting the navmesh agent move them. I am simply using the .SetDestination method of the agent. I’ve also just set the destination property. In both cases the destination doesn’t line up with the actual target I’m wanting them to go to.

I am setting the destination to the transform.position of another gameobject. When I debug.drawline to the transform.position of the target, and the agent.destination I get two different lines. The farther away the target is the bigger the offset.

Any ideas?

I have found the problem. The target in question is a nav mesh obstacle. When given a destination in an inaccessible area it picks a location close to the destination but not right at it. When i give a destination of an object that is not an obstacle they line up perfectly.