Hi everyone!
We’re adding a little minigame in an upcoming update where the player will play a rhythm minigame, press a button in timing with the music.
We will spawn button prompts in advance just like Guitar hero and other rhythm-based games.
How could we go about knowing in advance when our timeline markers/beat will happen?
Thanks for the help!
By settings markers one bar before in the timeline!
If your music is BPM constant, that should be quite easy.
So the first marker is just to say, hey spawn in the first, and then use FMOD’s beat callback for the rest?
If the BPM is constant would not be hard to copy around markers tho…!
I don’t really understand your problem. Use a callback at the moment you want your game to react. The first reaction you want is a visual prompt, so use a callback when you want that prompt. For the input, you can either use another callback, or deduce the right timing based on the prompt callback.
It turned out great, here’s the result (at 41:57)
Just to wrap up and provide some clarity, we ended up placing markers in each event, when the script detects a marker it spawns the “Note” that the player needs to hit, the annoying part is that we had to anticipate when to spawn it, it’s not synced dynamically.
So if there’s a beat 2 sec in the song we had a marker like 1.9 sec to spawn the note so it would be in the right spot at 2 sec. It’s definitely not a an ideal workflow or perfect by any means but we only had 3 songs.
That’s how we achieved the results we did from the video above.