And in Obj_A, I have a child empty Transform tf_A.
Also in Scene, at another position, I have Transform tf_B.
What I want to do is move tf_A towards tf_B, but keep tf_A in the bounds of Obj_A.
If I have the line vector defined by the two points that tf_A and tf_B make, I know I can get any point on that line, but how do I limit it to stay within the bounds of Obj_A? **Keep in mind tf_B can move anywhere and tf_A has to keep up, but with in its Obj_A bounds.
If your cube won’t rotate then this method is really good. But bounds is the volume that the object occupies in space. The image shows better how Bounds changes depending on the rotation of the object. The white frame is Bounds. The red dot is the closest point to tf_B .
There is also make raycast from tf_B in the direction of tf_A (which is inside the cube) and the point of contact of the beam will also be the border.
But if everything already works as expected, then you can leave your implementation.