Hey! I absolutely loved Fishjn! I've been humming the songs all day :D I'm really interested to know how you synced the gameplay to the sound so perfectly, its something I've tried and failed to do in the past. Any tips? Thanks!
Thanks! I’m glad you enjoyed it.
I have loads of tips! Something that’s incredibly useful in Unity is the Invoke and InvokeRepeating functions. These run independently from the game’s update loops (I think, otherwise they're the most precise timing tool available), which makes timing things to a beat more plausible. You’ll have to know the BPM of the song beforehand though, for InvokeRepeating.
In the InvokeRepeating function I generally call events using a custom Event Manager, similar to this http://wiki.unity3d.com/index.php?title=CSharpMessenger_Extended but simpler. These trigger all the pulsing colors and other nonsense that’s supposed to happen on the beat.
Another trick that I do, is I actually start InvokeRepeating three times, one of them happens just before the beat, one of them is on the beat, and finally one happens just after the beat. This is so I can create a window of opportunity to accept inputs.
The last super useful thing is AudioSource.PlayScheduled. I use this to make sure the music starts at precisely the same time as the InvokeRepeating functions. Also AudioSettings.dspTime is helpful to know about, but I can’t remember if I actually used it in the end.
I think that’s everything if there’s anything I can help clarify let me know.
Bronson












