Raycast reporting a collision in the wrong place

I’m having a strange problem with my raycasts.

I’ve a soldier character with some capsule colliders on various body parts to have body-part specific damage and they have a specific layer to only hit them. The character also has a character controller on the root. I currently use raycasts to grab whatever information I need on what the raycast hit.

For some reason, the raycasts are reporting a collision on a completely different position from the collider it supposedly hits. It would say it’s hitting the LlegUpperCollider but the hit point is somewhere a bit above the character. The editor shows that the collider is where its supposed to be. They seem to translate and orient themselves correctly with the character animation as well.

Here’s a screenshot:

I’ve circled the hit point and I’ve drawn an arrow to where the collider actually is.

You’ll see two lines. The red one, that shows the raycast direction and hit point, has its origin on the enemies weapon position and it finishes on hit.point. The blue one The red one has its origin on the enemies weapon position and it finishes on hit.collider.transform.position

The script is on the soldier gun and uses the soldier object to place the rays. Here is the code:

enemyTransform = enemyObject.transform;  // enemyObject is a GameObject (the soldier object)
var ray : Ray;
ray.origin = enemyTransform.position + enemyTransform.up * 1.5 + enemyTransform.right * 0.25;
ray.direction = enemyTransform.forward;

var hit : RaycastHit;
 		
if(Physics.Raycast(ray.origin + ray.direction * 0.1, ray.direction, hit, fireRange, hitLayer.value))
{	
			
   if (hit.collider.tag == GameManager.tagColliderHead || hit.collider.tag == GameManager.tagColliderChest ||	hit.collider.tag == GameManager.tagColliderExtremities) 
   {
      Debug.Log("CR -COLLIDER = "+hit.collider.tag+" name = "+hit.collider.name+"Hit.point = "+hit.point);
				
      Utils.DibujarLinea(line1, ray.origin, hit.point, Color.red, Color.red);
      Utils.DibujarLinea(line2, ray.origin, hit.collider.transform.position, Color.blue, Color.blue);

   }
}

Utils.DibujarLinea() is:

static function DibujarLinea(linea : LineRenderer, StartPoint : Vector3, EndPoint : Vector3, Color1 : Color, Color2 : Color)
   {
      linea.SetColors(Color1, Color2);
      linea.useWorldSpace = true;
      linea.SetWidth(0.02f,0.02f);
      linea.SetVertexCount(2);
      linea.SetPosition(0, StartPoint);
      linea.SetPosition(1, EndPoint);
   }

A typical mistake that I make all the time is to parent many objects each one with rigibodys and colliders this usually causes problems with positioning of some objects because the center automatically sets between the parent and child objects and also messes up forces try to un-parent the objects that have the colliders that are supposed to collide.