TransformPoint returns wrong points?

I have some code where I take a global position, convert that with InverseTransformPoint to local. I then split that variable up into two variables, one subtracts from it and the other adds to it (the same value is subtracted/added). When this stage is done the difference between the two, locally, are (0.2,0.2,0.0). However, after converting it back to global the difference between the two are (-4.7,-0.8,-0.8).

I’m aware it’s probably just my math or thinking that is off, but I thought I’d ask nonetheless. Does it return wrong points? Or is there some weird voodoo ritual I gotta do first?

Here’s the code I use for converting and tweaking (info is a RaycastHit, radius is a Vector3):

Vector3 localUpperRightCorner = (transform.InverseTransformPoint(info.point)+radius);
Vector3 localLowerLeftCorner = (transform.InverseTransformPoint(info.point)-radius);
Vector3 upperRightCorner = transform.TransformPoint(localUpperRightCorner);
Vector3 lowerLeftCorner = transform.TransformPoint(localLowerLeftCorner);

localUpperRightCorner - localLowerLeftCorner = (0.2,0.2,0.0)

upperRightCorner - lowerLeftCorner = (-4.7,-0.8,-0.8)

X&Y on the latter is supposed to equal the previous one’s.

One of my comments earlier:

Yes, I use a different scale. What I need done is to just plot out a small distance from one corner of the object to the other. The distance totaled to (0.2,0.2,0). This distance was plotted out on the surface of another object (thus the raycasthit). then I took those coordinates and made them into global, and they don’t align themselves to what they should’ve. Which is the issue I’m facing.

I assume that radius is a Vector3. I put the following code in Update() and played with the position and rotation of the game object. The magnitude between the local and global coordinates was always the same. But if I change the Scale of the game object, the values were no longer the same, which makes sense. I’m guessing that the game object you have the script above attached to has a scale other than (1,1,1).

	if (Input.GetKeyDown (KeyCode.A)) {
		Vector3 localUpperRightCorner = (transform.InverseTransformPoint(transform.position)+radius);
		Vector3 localLowerLeftCorner = (transform.InverseTransformPoint(transform.position)-radius);
		Debug.Log ("Local Distance = " + (localUpperRightCorner - localLowerLeftCorner).magnitude);
		
		Vector3 upperRightCorner = transform.TransformPoint(localUpperRightCorner);
		Vector3 lowerLeftCorner = transform.TransformPoint(localLowerLeftCorner);
    	Debug.Log ("world Distance = " + (upperRightCorner - lowerLeftCorner).magnitude);	
	}