Hello! I am trying to write code to properly play through a particular sub-sect of my LevelSequence. I am able to get the correct range, but the playback speed does not seem to be affected. I am making sure to set the PlayRate of FMovieSceneSequencePlaybackSettings but nothing seems to come of it. Here is my code:
void ASequenceManager::PlayRange(ULevelSequence* _playSequence, float _startTime, float _endTime, float _speed)
{
ULevelSequence* currSeq = MovieActor->GetSequence();
if (_playSequence != nullptr)
{
if (_playSequence != currSeq)
{
MovieActor->SequencePlayer->Stop();
MovieActor->SetSequence(_playSequence);
}
}
else if (currSeq == nullptr)
{
return;
}
MovieActor->PlaybackSettings.bPauseAtEnd = true;
MovieActor->PlaybackSettings.PlayRate = _speed;
FMovieSceneSequencePlaybackParams startParams = {};
startParams.PositionType = EMovieScenePositionType::Time;
startParams.Time = _startTime;
startParams.UpdateMethod = EUpdatePositionMethod::Jump;
MovieActor->SequencePlayer->SetPlaybackPosition(startParams);
FMovieSceneSequencePlaybackParams playTo = FMovieSceneSequencePlaybackParams();
playTo.PositionType = EMovieScenePositionType::Time;
playTo.Time = _endTime;
playTo.UpdateMethod = EUpdatePositionMethod::Play;
MovieActor->SequencePlayer->PlayTo(playTo);
MovieActor->PlaybackSettings.PlayRate = _speed;
}
Any help here would be appreciated. Is it possible I have to set the sequencer update method to scrub as opposed to play? Via:
playTo.UpdateMethod = EUpdatePositionMethod::Scrub;
I am unsure the difference here, and I have been struggling trying to find information on the difference between play and scrub.