Hey, i am currently struggeling a bit getting the Distance from the purple capsule, to the blue wall

So I know you can get the distance like this:

```
var distance = Vector3.Distance(transform.position, wall.transform.position);
```

and i also tried to flatten the distance like

```
Vector3 my2dPos = transform.position;
my2dPos.y = 0;
Vector3 target2dPos = wall.transform.position;
target2dPos.y = 0;
var distanceToTarget = Vector3.Distance(my2dPos, target2dPos);
```

but this is also not working out

.

.

the blue box got a rotation of 0, 45, 0

and the purple capsule is rotated -45, -45, 90

.

.

i placed the capsule 3m away from the box and also checked with a raycast that its 3m away,

but i would like to know, how to calculate the distance only by knowing the XYZ position of both objects