Setting a rewind amount for a UE4 Sequence in Blueprint
- @tomofnz
- May 4, 2018
- 2 min read
I'm planning to make a UI that lets the user drag a slider to control playback position (current time) of a sequence. The slider value has to set some value the Sequence understands, so first, just rewinding an arbitrary amount of the total Sequence time is a start. You can get the total time range of a Sequence, and you can set Playback Position with provided sequence commands.
First, in player controller add a widget or key command to Play your sequence and to Rewind it.
In the image below 'Play Sequence' is a custom function. So is 'Rewind Playing Sequence'.
The variable 'SequenceMaster' is established in 'Play Sequence', so let's move on to that...

In this case we're assuming there is only one sequence actor in the level, so we can get index 0 of the actor class Level Sequence. Notice after the Play node there is a float variable set for SequenceTotalLength, which is obtained from Get Playback End, that the level sequence actor kindly provides. This is set on Play, once, because it's the remaining time actually based on current play position.

Rewind Playing Sequence is a function that has a couple of small caveats. First you don't want to rewind more than the time that has played so far. Like 1s-5s. So we use a float > float branch to check our RewindAmount value is not more than the time played so far, which we get using Sequence>Get Playback Position.

I found that unless I Pause the sequence, set the new Set Playback Position value with a subtraction, then Start Playing Next Tick (all provided functions for sequences), then I'd get a sort of sloppy rewind with a delayed onset. With the momentary Pause, the accuracy of the jumpback in playback time is perfect every time.
Comments