Moving my unit up to a certain distance from target

Hi guys,

This might be a bit silly, but I’m not exactly sure where to look in order to find the answer to this or what I need to change in the scripts.

So all objects in my scene have the same size (everything is a 1-unit cube as per Unity default).
My main “player” cube can be moved by clicking anywhere on the ground, has a nice AiPath script on him, each time I click, a target is set at the mouse click and the player cube moves there, everything is fine and dandy.

Now the problem is the following: sometimes I want to stop a certain distance away from the target (in this case, 1-unit away). Concrete example: my player can build things, let’s say I am building the walls of a hut (again, they all take the same 1-unit size to avoid calculation issues). I want my player to stop 1 unit away from the target so that when he’s finished building, the wall doesn’t pop up underneath the player, overlapping and getting stuff stuck. This also means that if the player is ALREADY on top of the target, he needs to move 1 unit away until he considers that the target is reached.

Can this already be done with the stuff in the project or do I need to get creative myself?
Thanks a lot everyone

Alright, answered my own question (so in case someone has a similar conundrum):
I eventually found out about MultiTargetPath.
So you can either MultiTargetPath to all relevant points around the destination point and determine which point is the best solution (if you have the pro version), or use the free version example to do about the same thing.
I added a dummy to my player which holds a Seeker as well, this seeker calculates the best path that’s 1-unit away from the chosen target and then moves the target of the player’s AIPath to that point.

http://arongranberg.com/astar/docs/_multi_target_path_example_8cs-example.php
http://arongranberg.com/astar/docs/_multi_target_free_8cs-example.php