Controlling game elements with timeline

I’m working on a rhythm game, and I was wondering if I could use the Timeline to be the primary driver for all my rhythm-related gameplay features. I’m pretty new to timeline, so I was wondering if anyone knew how to implement these 3 things. I know that the TimeLine has a bunch of different tracks that all do different things. You don’t have to go into detail about code, I’m moreso wondering what you think the best approach would be and what track types I should look into.

1. Record button inputs on a timeline track
To make it easier for myself I would want to create a different scene where I would play the music on a timeline and then record my button inputs onto different tracks. In more detail, the rhythm aspect of my game will only use left and right click, so optimally I would like to create one track that would record each button input. This is so that I can avoid having to place every note myself onto the timeline.

2. Check inputs through a timeline track
After all the notes have been set onto the track, I would like for them to control a script that would check for the right player input corresponding with the right note. As far as I can understand, in Timeline terms the notes would need to be short clips, the length of which would be the time the player has to correctly input this button. During the clip it would then check for this input.
3. Visualize the notes in the UI
The way I was thinking to implement this is to put “UI” clips in front of every note, that would then generate a note in the UI which would slide down as the clips plays, onto the checkbox at the bottom.

_
Or maybe there is a much more efficiënt way of creating rhythm games. The only tutorial I could find on YouTube uses a UI panel with the notes on it that slide down according to the BPM of the music, on this panel are notes that check for input when colliding with the checkbox at the bottom. My problem with this is that I’m afraid that due to whatever circumstances the music would not be synced anymore with the notes. If all the rhythm stuff would be controlled in the same timeline the music was playing, I could avoid this issue, and in general I think it would be a much more efficiënt approach. Let me know what you think! Any answer will be highly appreciated! :slight_smile:

  1. You can use the recorder track to do that. You will need to create a component where every frame you read the mouse input state, and save it to component properties, then use the recorder to record these properties. This will give you an animation clip with your Rightmouse/Leftmouse properties recorded. You can then use this as the skeleton to build your clips. The recorder track is part of the recorder package which is separate from Timeline.
  2. You should use a component for this, and just make a track that tells the component what to expect at a given time. This will be easier than trying to do input parsing in your track, and more in line with how Timeline is supposed to work.
  3. I don’t have a strong opinion on this.

Timeline has the option of synchronizing with the audio clock, so it’s a great fit for audio-based gameplay that should let you rapidly start without having to deeply learn the details of the audio system. You could probably do it some other way, but I believe Timeline is the easiest way of getting started.