Hi!
I found bug, or strange behavior of Sequencer Player.
-
Create Empty C++ Project.
-
Create Level Sequence. And add it to the Current Level.
-
Add Fade track, and set fade from 0 to 1 (cinematic must finish with full faded screen).
-
Modify Game Mode header file like this:
UCLASS() class SEQUENCERLASTFRAME_API ASequencerLastFrameGameModeBase : public AGameModeBase { GENERATED_BODY() public: UPROPERTY(Transient) class ALevelSequenceActor* cinematic; public: virtual void StartPlay() override; UFUNCTION() void OnCinematicStop(); };
-
Modify Game Mode source file like this:
void ASequencerLastFrameGameModeBase::StartPlay() { Super::StartPlay(); TActorIterator<ALevelSequenceActor> It(GetWorld()); if (It) cinematic = *It; if (IsValid(cinematic)) { cinematic->SequencePlayer->OnStop.AddDynamic(this, &ThisClass::OnCinematicStop); cinematic->SequencePlayer->SetPlaybackPosition(0.0f); cinematic->SequencePlayer->Play(); } } void ASequencerLastFrameGameModeBase::OnCinematicStop() { auto It = GetWorld()->GetPlayerControllerIterator(); if (auto PC = *It) { PC->PlayerCameraManager->StartCameraFade(1.0f, 0.0f, 1.0f, FLinearColor::Black, false, true); GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("CameraFade called, but nothing happened!")); } else GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("PC not found!")); }
-
Don’t forget to add “LevelSequence” to build.cs.
-
Compile and start play.
We see black screen and text “CameraFade called, but nothing happened!” in the left top corner. Looks like function SetManualCameraFade called one more time in FMovieSceneFadeTrackInstance::Update after the OnStop delegate called.
Project with bug you can find here:
https://github.com/maltsevda/SequencerLastFrame