Hello,
I have created a Level in my game and added a level sequence to the Game Mode the level is using with the ULevelSequencePlayer in C++. However, when I duplicated my level to make a Level 2 in my game the sequence stopped working in the duplicated level.
The circled blueprint graph is what I converted into the C++ RunRoute function inside the MontageManager subsystem:
Here is what that C++ function looks like
bool
UMontageManager::RunRoute()
{
if (CameraRoute.Num() > 0)
{
UWorld* CurrentWorld = GetWorld();
if (CurrentWorld != nullptr)
{
//Possess the new montage camera actor
AActor* FoundActor = UGameplayStatics::GetActorOfClass(CurrentWorld, AVIEBasePawn::StaticClass());
CurrentWorld->GetFirstPlayerController()->Possess(Cast<AVIEBasePawn>(FoundActor));
//Create the level sequence player
ALevelSequenceActor* LevelSequenceActor = nullptr;
FMovieSceneSequencePlaybackSettings PlaybackSettings;
ULevelSequencePlayer* SequencePlayer = ULevelSequencePlayer::CreateLevelSequencePlayer(CurrentWorld->PersistentLevel, CameraRoute[iCurrentSequence], PlaybackSettings, LevelSequenceActor);
if (SequencePlayer != nullptr)
{
//Play the sequence
SequencePlayer->Play();
return true;
}
}
}
return false;
}
Here is a screenshot of the duplicated level asset. I just copied the Minimal_Default level and made Minimal_Default_2 but when I play the new level the sequence does not work.
I stepped through the code and the function appears to be acting normally because
SequencePlayer->Play();
is called, and in the Game Mode event graph I see the call in the blueprint also going through.
So what’s going on here? Anyone have any ideas?