0

I'm trying to make an object's movement automatically sync to the music in Unity. I want a way to get the "key points" (when there is a loud beat) and make the object dash at those moments.

Basically, I just want the object to feel like it is synced with the music.

So how would I be able to get these points? A simple code or an explanation of a function I could use would be appreciated.

DMGregory
  • 134,153
  • 22
  • 242
  • 357
Howler
  • 171
  • 1
  • 8

1 Answers1

-1

I used an open source code to do this.

It's a Unity project by retrogeek46 and the link is: https://github.com/retrogeek46/Beat-Detection---Unity

In the project there is a script which detects a beat and changes the cube's color (in the Update()) when a beat occurs.

Howler
  • 171
  • 1
  • 8
  • Please note that answers on Stack Exchange should answer the question directly, and not just link to another website that contains the answer. See also Are answers that just contain links elsewhere really "good answers"? on Meta-Stackexchange. To improve this answer, you could dive deeper into that git repository to find out how exactly it accomplishes beat detection and explain their approach in your answer. – Philipp Nov 22 '23 at 16:49
  • Showing code for how you used the API provided by this package to integrate it into your game would also be helpful to future readers, who can learn from your example. – DMGregory Nov 22 '23 at 17:21