How can I stop a Level Sequence from resetting at the end ?

Apologies for the troubles you guys are having.

So, actually can you try setting the “When Finished” property on the animation section to “Keep State”? We added this setting to each of the track sections so you could have more control over what each section does. The “RestoreState” doesn’t act as an overall override for this behavior as I incorrectly mentioned in my initial comment.

202335-sequencer_whenfinished.jpg

4 Likes

I found a small workaround based off another post.
Even with 4.17, the issue still persists on MAC. And I’m only assuming that Mac is the issue.

But, as a test I set up an animation, 17 frames on a box going from close to open.
Of course in the Level Sequencer when I get to 17 it resets to the first frame pose.

So I used a Set Playback Range node. You only have to know the last frame you want to stop it at, in my case frame 16.

I hope this works for some of you until the issue is fixed.

is there any way to set When Finished - Keep State on a per-animation or per-project level? We have a lot of tracks that used to keep state in 4.14, and don’t do it in 4.16.a

Unfortunately, no. When upgrading, existing tracks from 4.14 should have defaulted to KeepState.
We can look into adding a preference for this in the future, but as we just hit feature complete for 4.18, it won’t be available until at least 4.19.

Neat. It looks like more of my tracks defaulted to Keep State than I had thought when I first started looking into it, so it wasn’t as big a problem as it seemed.

Worked on UE4.18 on Windows. I think Keep State should be the default indeed. @Titirez, you should have posted your answer as a comment since it states the bug also affects you and mentions ideas that failed, but not an answer. @Max.Chen now answered in a comment but that’s not very convenient. Maybe we should repost it properly?
UPDATE: just did it

Just to repost Max.Chen’s answer inside a comment:

In the Level Sequence, right-click each track that shouldn’t reset, select Properties > Section > When Finished > Keep State.

See discussion about defaulting to Keep State and doing this for all tracks at once after Max.Chen’s comment-answer.

202335-sequencer_whenfinished.jpg

3 Likes

The sequencer tool is much nicer to use than the timeline tool in BP in my opinion. I hope the sequence BP component will be in the next stable build. alt text

Ah yes this works for my fancy door too!

As of UE4.19 you can set the default to Keep State.
What's New | Unreal Engine 5.1 Documentation (search “When Finished”)

Should be in DefaultEngine.ini (if not, try other ini files)
[/Script/LevelSequence.LevelSequence]
DefaultCompletionMode=RestoreState → KeepState

Haven’t installed 4.19 yet so I haven’t tested.

I am guessing someone has added this under the radar? I haven’t git blamed it to find out who :D, however, this is the answer to the problem:

MovieSceneSequencePlayer.cpp ln:623

	// stop playback
	else
	{
		// Clamp the position to the duration
		NewPosition = FMath::Clamp(NewPosition, FFrameTime(StartTime), GetLastValidTime());

		FMovieSceneEvaluationRange Range = UpdatePlayPosition(PlayPosition, NewPosition, Method);
		UpdateMovieSceneInstance(Range, StatusOverride);

		if (PlaybackSettings.bPauseAtEnd)
		{
			Pause();
		}
		else
		{
			Stop();

			// When playback stops naturally, the time cursor is put at the boundary that was crossed to make ping-pong playback easy
			PlayPosition.Reset(NewPosition);
		}

		PlaybackSettings.TimeController->StopPlaying(GetCurrentTime());

		if (OnFinished.IsBound())
		{
			OnFinished.Broadcast();
		}
	}

You’ll see that bPauseAtEnd is allowing it to go back into a Reset call.

You can turn it off under the split version of the blueprint:

I tested huulong’s solution in 4.21 to change the default to Keep State, and it works.

Add this to DefaultEngine.ini:

[/Script/LevelSequence.LevelSequence]
DefaultCompletionMode=KeepState

4.20 works too. Should be marked as an alternative answer. Thank you very very much sir. To be honest, since you can switch the behavior for specific actors in the timeline, KeepState should be default by default.

Thank you very much Huulong! I’ve been looking for those 2 little lines and where to put them for ever!

Ah, thank you huulong!! I thought I was about to have to go through them 1 by 1!!

Thank you so much !