set relative location doesn't work

​void UTargetTracker_indicator::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
	if (ActorClassArrow&&ActorClassTarget&&GetOwner()&&IsNotSpawned)
	{
		FTransform OwnerTransform =GetOwner()->GetTransform();
		CurrentLocation=OwnerTransform.GetLocation();
		CurrentLocation.X += 100.0f;
		OwnerTransform.SetLocation(CurrentLocation);
		GetWorld()->SpawnActor<AActor>(ActorClassArrow,OwnerTransform);
		IsNotSpawned=false;
	}
	if(!IsNotSpawned)
	{
		FVector NextLocation=GetOwner()->GetActorLocation();
		NextLocation.X+=100.0f;
		
		   GEngine->AddOnScreenDebugMessage(-1,15.0f,FColor::Yellow, FString::Printf(TEXT("%s"),*GetOwner()->GetActorLocation().ToString()));              
						 
			SetRelativeLocation(NextLocation);
		
	}
	// ...
}

Here’s my code. The location doesn’t change after set location.

This topic has been moved from International to Programming & Scripting: C++.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Hopefully, this category change will help to get an answer. In the meantime, good luck and happy developing! :slight_smile: