rive-unity icon indicating copy to clipboard operation
rive-unity copied to clipboard

Scrub timeline

Open BitBarrel opened this issue 2 years ago • 3 comments

How do I scrub through a timeline in Unity?

BitBarrel avatar Dec 02 '23 15:12 BitBarrel

We don't expose this directly Unity. We currently only expose state machines which control animations (timelines). You could create a state machine that scrubs to certain times and control inputs to drive from Unity.

We can also expose the ability to drive animations manually from Unity which would let you manually scrub timelines.

Can you share more details about what you're trying to do?

luigi-rosso avatar Dec 02 '23 16:12 luigi-rosso

Can you share more details about what you're trying to do?

I am making a technical training app (featuring an aircraft display). It is essential that I can set an animation timeline location directly without using a state machine to set the exact location of a complex animation. Although it is possible to use a blend state machine to set the exact location of an animation, this only works well with simple timelines and is cumbersome and not intuitive to set up. It would be much easier and less restrictive if a timeline location could be set directly using a scrub feature in code.

For example, instead of setting the speed, try setting the altitude of this aircraft display to the exact altitude of 7865.3 ft, or any other precise number.

https://rive.app/community/6819-13114-altitude-rolling-numbers/

That is currently not possible either with a state machine nor in code in Unity.

BitBarrel avatar Dec 02 '23 23:12 BitBarrel

We have a similar use case which requires the use of Unity Timeline to allow the user to scrub through short cutscenes created within our app. We'd like to try using Rive to handle character animations, but would need this frame-level control. Is this on your roadmap?

chris-crucible avatar Apr 25 '24 03:04 chris-crucible

The recommended approach now is to use data binding. This suggestion should cover this use case.

damzobridge avatar Sep 03 '25 23:09 damzobridge