Spawn tile at next position for endless runner in C++

Hi, I have set up my tile similar to this Youtube Video. Every time I spawn the tiles, they get spawned in the exact same spot, rather than spawning one after the other, which can be seen in this Youtube Video. I have tried converting the blueprint code in C++.

Here is my code:

void ARunnerGameModeBase::SpawnTile()
{
	AFloorTileActor* floorTile = GetWorld()->SpawnActor<AFloorTileActor>(FloorClass); 
	AFloorTileActor* floorTileCast = Cast<AFloorTileActor>(floorTile); 
	floorTile->SetActorLocation(floorTileCast->SpawnPoint->GetComponentLocation()); 
	
}

What do I need to change to get it to work correctly?
Thank you

Hi! I think that you should use SpawnPoint property of previously created floorTile to place correctly the next one, not self property