Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Best way to make a rhythm game using Timeline?

Discussion in 'Timeline' started by TimeForToast, Feb 20, 2021.

  1. TimeForToast

    TimeForToast

    Joined:
    Apr 29, 2019
    Posts:
    2
    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. I'm 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's clips
    After all the notes have been set onto the track, I would like for the track or the clips 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. While the clip is being played it would then check for this input.

    3. Visualize the notes in the UI
    One problem I would have is that the notes would also needed to be visualized for the player, of course. The way I was thinking to implement this is to put "UI" clips in front of every noteClip, that would then instantiate a noteObject in the UI which would slide down as the clips plays, onto the checkbox at the bottom where the player would need to press the button. The checkbox won't actually check input, and is simply the visual aid for the player to get the timing right.

    I've already done some digging regarding the different tracks, as well as the recorder feature, but just can't wrap my head around how to start coding this. As far as I can tell, I would need a Controller track for this, but have no idea how to create clips in code. Most threads are about animation clips, which I'm pretty sure I can't use for this.

    On a side note, I feel like the documentation regarding the tracks is extremely vague and barebones, except the animation and audio tracks, since theyre pretty easy to use anyways. I don't think anywhere it states how to use code to control or create clips or what not, or maybe I just completely looked over that.

    Any answer will be highly appreciated, and thank you in advance for you time!