SetActorScale3D Causes Crash When Object is Detached

Hello,

So Ive been trying to scale objects dynamically. Essentially my player can Pick an object up, scale it , and put it back down.

I can set the scale and everything looks correct however if the player picks the object back up after its been scaled and moves it it immediately crashes the editor with an access violation.

if (triggerHeld)
	{
		triggerHeld = false;

		FVector endPosition = triggerStartPosition - GetActorLocation();
		endPosition /= 10;
		FVector FinalScale = heldObjects[0]->GetActorScale() + endPosition;

		if (FinalScale.X < 0)
		{
			FinalScale.X = 0.25;
		}
		if (FinalScale.Y < 0)
		{
			FinalScale.Y = 0.25;
		}
		if (FinalScale.Z < 0)
		{
			FinalScale.Z = 0.25;
		}

		heldObjects[0]->SetActorRelativeScale3D(FinalScale);
	}

The Above Code Sets the scale this works and is reflected in the editor. The code below is what is used when the player drops the object.

void AHandActor::releaseObjects()
{
	for (int x = 0; x < heldObjects.Num(); x++)
	{
		heldObjects[x]->DetachRootComponentFromParent(); // Breaks Editor
		heldObjects[x]->connectToParent(); //Connects to other local object
		heldObjects[x]->ModelActorMesh->SetRenderCustomDepth(false);
	}

	heldObjects.Empty();

	return;
}

Held Objects is A TArray of ModelActors which is essentially just an inherited actor with a StaticMesh and a couple of supporting functions.

Does Unreal have some problem with Detaching from a parent with a scaled child? Is there a proper way to do this that doesn’t cause an editor crash.

46846-capture2.jpg