Increase/decrease values of hit.point

Hi,

I have a character that should walk to the point (“walktarget”) where I place an object or building. The objects are placed with a raycastHit but with a normal hit.point the character wants to walk trough the object… How can I decrease/increase the values of my hit.point so that my character stops right next to the object?
This: walktarget.transform.position = Vector3(hit.point.x - 15, hit.point.y, hit.point.z - 15) doesn’t seem to work because the target isn’t inside the grid for the A* pathfinding…

Thanks

Do a second ray cast after the building/object has been placed, to find where the vector between player and walktarget intersects the obstacle. Then reset walktarget to the closest valid position on the player’s side of the object.

Brilliant :lol:
Thank you!!