Problem with AttachToComponent

I’m trying to program the boomerang throwing mechanic. So the boomerang I have attached to the hand with a child object component. When I launch it, I undo it from the hand with a DetachFromComponent and activate the physics with a SetSimulatePhysics of the boomerang. Then when the boomerang is going to regrease I deactivate the physics and when it is close to the player I match it to the hand with AttachToComponent, but the latter does not work. . I have seen on the internet that it gives problems to use AttachToComponent and SetSimulatePhysics and that it should be the object that activates and deactivates the physical rootcomponent but in this case the boomerang should be related to the hand.

Adjunto las lines de codigo donde hago esas acciones.

Constructor of my Player class.

boomerangChild = CreateDefaultSubobject<UChildActorComponent>(TEXT("BoomerangChild"));

When the player throws the boomerang.

void ABoomerangUE4Character::LaunchBoomerang()
	boomerangChildLocation = boomerangChild->GetRelativeLocation();
	boomerangChildRotator = boomerangChild->GetRelativeRotation();

	FTimerHandle timerHandle;

Launch of the Actor Boomerang

void ABoomerang::LaunchBoomerang()

	launchBoomerang = true;

When it returns in the player

void ABoomerangUE4Character::TakeBoomerang()


When he returns in the boomerang actor

void ABoomerang::ReturnBoomerang()
	returnBoomerang = true;

The Tick function of the Boomerang Actor

		FVector playerLocation = GetWorld()->GetFirstPlayerController()->GetPawn()->GetActorLocation();
		timeToReturn += DeltaTime;

		if(FVector::Distance(playerLocation,GetActorLocation()) <= 50)
			timeToReturn = 0;
			launchBoomerang = false;
			returnBoomerang = false;

I don’t know how to fix this.
Thanks a lot.

Thank you very much for the reply! That is, I have to update the position of the child actor component with my actor?

Hello! After you enable physics for Boomerang Actor, then relative transform between it and UChildActorComponent changes and there is no code to erase those changes. Also check UChildActorComponent transform - maybe it is not changing at all…

You need to update Boomerang actor transform…

But wouldn’t it be better to update the childactorcomponent? Anyway, I already managed to solve it by simply not activating the physics since in my case I only needed the collisions. Thanks for your time!!