Adding timelines

Updated: 2018-09-06


Now that we have our global clock, we need to tell our enemies to look at it! For that, we only need to add a Timeline component to the enemy prefabs.

Locate the enemy prefabs: they should be located at Prefabs/Characters/enemy1 and Prefabs/Characters/enemy2. Using the same method as in the previous step, add a Timeline component to each.

Timelines have two modes: one for observing a local clock, and one for observing a global clock. Since our case is the latter (we want to point at the "Enemies" clock we just created), set the mode to Global, and the Global Clock to "Enemies".

The timeline will automatically take care of synchronizing the animation on our enemies, along with the the transform and physics (make sure you check the Rewindable option), with its time scale. It will also allow us to use timing measurements in scripting later on.

Feel free to play around with the recording time and interval properties; these will affect how long your rewinds can be, and how precise they feel.

Allowing more rewind time or precision takes more memory (RAM). The default values should offer a decent duration and precision for most cases, but don't be afraid to increase them! Chronos is well optimized in that regard, so you should almost certainly be able to meet the needs of your game. The inspector will instantly show you how much memory will be allocated by the timeline.

Chronos supports multiple object editing for all its components. For example, you can select the enemy1 and enemy2 prefabs at the same time and create both timelines at once.


We also want to give an audio feedback to the player so they understand how time is progressing. For this reason, we will synchronize the music with the time scale of our enemies. To do that, simply locate the music object in the scene hierarchy, and attach at timeline to it, pointing at the same "Enemies" clock. That's it! Chronos will take care of adjusting the pitch of the audio source for you.

Was this article helpful?
Be the first to vote!
Yes, helpful
No, not for me