Double Scale when SnapTo Socket

In SnapTo we call AttachTo with EAttachLocation::SnapToTarget.

Here we first save our new pointers:

// Save pointer from child to parent
AttachParent = Parent;
AttachSocketName = InSocketName;

And then do:

case EAttachLocation::SnapToTarget:
			// Zero out relative location and rotation so we snap to the parent's transform
			{
				RelativeLocation = FVector::ZeroVector;
				RelativeRotation = FRotator::ZeroRotator;
				if(bAbsoluteScale)
				{
					RelativeScale3D = ComponentToWorld.GetScale3D();
				}
				else
				{
					// when snap, we'd like to give socket or bone scale only
					// to do so, get parent and get socket relative to parent
					FTransform ParentToWorld = AttachParent->GetComponentToWorld();
					FTransform SocketTransform = AttachParent->GetSocketTransform(AttachSocketName);
					FTransform RelativeTM = SocketTransform.GetRelativeTransform(ParentToWorld);
					RelativeScale3D = RelativeTM.GetScale3D();
				}
			}
			break;

We change our RelativeScale3D to socket RelativeScale3D.

But next we call:

// calculate transform with new attachment condition
		UpdateComponentToWorld();

Which call:

UpdateComponentToWorldWithParent

Which call:

CalcNewComponentToWorld

const FTransform RelativeTransform(RelativeRotation, RelativeLocation, RelativeScale3D);
	const FTransform NewTransform = CalcNewComponentToWorld(RelativeTransform, Parent);

And here we do:

const FTransform ParentToWorld = Parent->GetSocketTransform(AttachSocketName);
		FTransform NewCompToWorld = NewRelativeTransform * ParentToWorld;

We get our modificated RelativeScale3D and multiply them again.