In Blueprint we have the following function
How can we achieve the same in C++ and control the location and rotation of the loaded level? I have the following code, but it’s not working, and the transform remains unaffected.
void AStreamingLevelController::LoadNextStreamingLevel()
{
FLatentActionInfo LatentInfo;
UGameplayStatics::LoadStreamLevel(
GetWorld(),
LevelToLoadName,
true,
true,
LatentInfo
);
ULevelStreaming* LevelStreaming = UGameplayStatics::GetStreamingLevel(GetWorld(), LevelToLoadName);
LevelStreaming->LevelTransform = LoadLevelTriggerActor->GetTransform();
}
No matter where LoadLevelTriggerActor
is, I get the same result. How can I control its transform?