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