# Measure the distance between sockets of separate Components?

Hello there. I am at my wits end. I have tried pretty much everything i can to get my issue to work. What I am trying to do has been done by many others yet for some reason it is killing me slowly.

I have a first person set up. I have a gun. This gun has Iron sights of which I look down.
I have an inventory system. I also have a weapon system within that inventory for attachments.
I attach a sight to my gun. I need to now look down the sight rather than the iron sight.

simple yes?
No.

What I have set up is 2 arrow components to mark locations within my character. 1 represents the hip location, the other represents where to put the gun when aiming. I can lerp between the hip and iron sights 0 problems.

Now, I add a sight. I need to find out the distance to move the gun in order to look down the sight so I use a “Distance (vector)” node and get the Z of TWO different components within my character. The 2 components are the weapon itself (Skeletal) and the sight (skeletal or static). I have sockets on each. the socket on the weapon is at the position of the iron sights. The socket of the sight is positioned at the center reticle (the dot of a red dot sight).

If i get the distance as relative, the measurements are not accurate to each other. And as a world space measurement, this is where I am having issues.

As I look up and aim, the distance is a certain value, if i look down and aim, it is also a completely unique value, and every direction on the pitch that I look, you guessed it, a different value. Despite the value looking like something I’m going for (a low value as the distance is small) it changes based on my camera pitch. I have the weapon attached to the camera to follow the rotation and I should note, MY CHARACTER HAS NO MESH. So imagine a floating gun in front of the camera.

My best guess is that the distance between sockets cannot measure between these 2 separate components. So how Can I do it?

And I swear I have tried every which way of doing this. So How does everyone else do it successfully. What do fps games do that I am doing wrong???

Also to note, I cannot use a hard value as an adjustment on the Z for the sight because I plan on different sights and different weapons so the Z value will never be the same. Although using a hard value doesn’t cause me problems which leads me to believe it is a problem with the distance measuring.

I appreciate your patience and commitment to solving this problem in advance.
I have been at it for 5 straight days and I need to sleep at some point.