Hi @acMacav
As promised, here is a controller script and example scene. This depends on the Timeflow example assets using URP and includes some scripts for basic gameplay. This will all be included in the next update and I may refine it some more, but in the meantime please import this package (for use with Timeflow 1.1.0).
https://www.dropbox.com/scl/fi/san9s8yg9e5xnevsm6tke/TimeflowController_v1.1.0.unitypackage?rlkey=fvdc6fqww3jo17b1orgiz8a3b&dl=0
I plan to make a video walking through this example and will share it when ready. Until then, hopefully you are able to look through the scene and understand what is going on so you can get things going in your project.
To test it, open the Cutscenes scene and enter play mode. Use the WASD keys to move the player (blue capsule) to any of the the 3 colored pads. As soon as the player touches one, it triggers the corresponding cutscene animation. Additional logic is also performed by Unity Events configured in the editor.
All of the cutscenes are animated with the same instance of Timeflow, separated by marker regions. Each region is defined by a start and end marker, with extra time padding between them. The padding is a bit overkill in this example, but I thought it would be useful as a starting point.
With this setup it is easy to preview and edit animations in edit mode. Double-clicking on a marker sets the work area and frames the region in time. You can also use the arrow icons in the upper right to step through markers.
The TimeflowController script provides a useful interface to manage the playback of Timeflow and uses Unity Events to setup custom logic without additional coding, though it can certainly be used via script too. In the screenshot below, you can see that the SkipButton UI element is shown or hidden based on whether a cutscene is playing. Pressing the Skip button causes the time to fast forward to the end of the cutscene with an optional outro time (Skip Duration).
You’ll also notice that the events in the above screenshot also enable/disable the player input controller, so that the player cannot move while the cutscene is playing.
Each of the pads has a trigger collider and a simple TriggerEvent script which uses Unity Events to notify the TimeflowController. The OneShot mode is best suited for a cutscene and means that the marker region plays just once through and when it reaches the end playback stops automatically.
For the Player object, I setup a Follow behavior which is animated in each cutscene to reposition the player at the designated positions with a transition controlled by Follow.OverallBlend in a keyframe channel. When the blend value is at 0 the Follow behavior has no effect, and at a value of 1 it is fully on target. Animating the blend value form 0 to 1 transitions the player from wherever it is in the scene to the desired location.
There are of course many things that could be improved, but hopefully this gives you a decent starting point. I’d love any feedback and any ideas to make it easier and/or more robust. I plan on creating a more sophisticated cutscene manager in the future.
Let me know if you have any questions or run into problems.
P.S. You may have to go to Preferences>Timeflow to enable Expose All Properties as I noticed that the Follow behavior was not being listed in the context menu when adding a new animation channel (making its parameters inaccessible). This will be fixed in the next update.
Best,
Axon