Changing speed on a sequence of intervals

I have a large number of positional / rotation points that I feed into LerpPosHprInterval and then nest / append them into a Sequence to loop. I would like to change the speed of the loop dynamically during play.

I’ve seen that this isn’t possible to change the play rate or duration of the sequence / interval. I’ve tried changing the playRate on a IndirectInterval on its own, but once you nest the IndirectInterval inside of the Sequence I wasn’t able to control it.

It has been suggested in the past to create a Task to handle this type of thing, but I’m not 100% sure about how to go about it.

I’m thinking that I could create a list / array of IndirectIntervals that move my node from point a to b, b to c, c to d, etc. I could then loop through the list / array changing the playRate on each interval in the list.

The part I’m not sure about how to do is to mimic a Sequence using a Task. On each frame determine if the current interval has stopped playing and if so move to the next, etc ?

If anyone has any thoughts on my approach or a better way to do this, please let me know.

Thanks so much.

You can call:

interval.pause()
interval.setPlayRate(x)
interval.resume()

to dynamically change the play rate of an interval while it is playing. Of course you may only do this on the outermost Sequence; once you add an interval to a Sequence or Parallel, you may no longer control that interval directly at all, you may only control the outermost interval.

David

Thanks David.

I had read that it wasn’t possible somewhere in the forums and it was crashing on me when I tried to set the playRate.

By using pause() first followed by resume() it now works.

Thanks!