I have two vectors that look the same, but apperently they are not and I don’t understand why
float distanceToStartPosition = Vector3.Distance(transform.localPosition, startPosition);
Debug.Log(gameObject.name + ": " + transform.localPosition + " <-> " + startPosition + " = " + distanceToStartPosition);
Debug.Log(gameObject.name + ": X: " + transform.localPosition.x + " <-> " + startPosition.x + " = " + Mathf.Abs(transform.localPosition.x - startPosition.x));
Debug.Log(gameObject.name + ": Y: " + transform.localPosition.y + " <-> " + startPosition.y + " = " + Mathf.Abs(transform.localPosition.y - startPosition.y));
Debug.Log(gameObject.name + ": Z: " + transform.localPosition.z + " <-> " + startPosition.z + " = " + Mathf.Abs(transform.localPosition.z - startPosition.z));
Results in
myGameObject: (-2.6, 2.0, 0.0) <-> (-2.6, 2.0, 0.0) = 9.536743E-07
myGameObject: X: -2.6 <-> -2.6 = 0
myGameObject: Y: 2.000001 <-> 2 = 9.536743E-07
myGameObject: Z: 0 <-> 0 = 0