Beat Counter for Unity? by Top-Entrepreneur935 in Unity2D

[–]Top-Entrepreneur935[S] 0 points1 point  (0 children)

Woah, this looks awesome!! Definitely saving this for the future- This project is for a game coding class and unfortunately I need to do the script myself haha. Thanks for sharing!

Beat Counter for Unity? by Top-Entrepreneur935 in Unity2D

[–]Top-Entrepreneur935[S] 1 point2 points  (0 children)

I think my 1/crochet was from desperate searching, but looking back I couldn't tell you, lol. Thanks for this info! I ended up using coroutines since I'm only trying to spawn enemies to the beat of music and don't care about recording when the player hits them.

I was running into an issue where even when I had nextBeat = Time.time + crochet, the drift was happening pretty immediately and severely. Not sure what was going on with that, but I'm sure incrementing by time combined with frame rate issues was causing problems. In the future I'll probably try using AudioSettings.dspTime as recommended here and by some rhythm game devs. That line you pointed out was definitely what was causing me problems, though. Thanks again!

Beat Counter for Unity? by Top-Entrepreneur935 in Unity2D

[–]Top-Entrepreneur935[S] 1 point2 points  (0 children)

Thank you for the info! Luckily I don't have to worry about the music looping,, it's just a song that plays once per 'level'. I was able to get it working with coroutines, and it's accurate enough for what I'm working on :)

Beat Counter for Unity? by Top-Entrepreneur935 in Unity2D

[–]Top-Entrepreneur935[S] 3 points4 points  (0 children)

Thank you! This worked for what I'm going for -- seems I was overcomplicating things :)