I’m looking a way to call my method after level loading, but looks like the UGameplayStatics::LoadStreamLevel() method ignores my LatentActionInfo.
For example, I have “MovePlayerToLocation” method, which calls level loading:
void UMyGameInstance::MovePlayerToLocation()
{
FLatentActionInfo ActionInfo = FLatentActionInfo();
ActionInfo.CallbackTarget = this;
ActionInfo.ExecutionFunction = FName("MovePlayer");
ActionInfo.UUID = 123456;
UGameplayStatics::LoadStreamLevel(this, FName("level name"), true, true, ActionInfo);
}
In the same class I have “MovePlayer” method, which I want to call after a new level will be loaded:
void UMyGameInstance::MovePlayer()
{
UE_LOG(MainLog,Warning, TEXT("MovePlayer!!!"));
}
It loads a level, but doesn’t trigger this “MovePlayer” method.
I can’t find any examples of this LatentActionInfo usage. Looks like it’s used from Blueprint, but how to do this in C++?