- Home /
How I can change the speed of an object with the speed of sound so they are evenly matched?
I'm doing a game like guitar hero, but I have a serious problem, the speed with which lower the object depends on how slow is the computer, but the speed of the song is at the real velocity. I want to change the velocity of the object depending of the song velocity so when the notes come match the same as the song. Or in case of dont work do otherwise, the velocity of the object changes with the slow of the computer and the song match with the velocity of the object. But I prefer the first one.
Please help me. :)
Answer by Jesse Anders · Oct 03, 2010 at 07:39 PM
I didn't quite follow your question, but generally speaking, how fast an object moves shouldn't be dependent on how slow or fast the computer is (within reason, at least). Typically, you'd use the built-in physics system or make the speed of motion framerate-independent by scaling by Time.deltaTime, which should cause your objects to move close to the same speed regardless of the performance characteristics of the computer the game is running on.
Regardless, although this may have changed somewhat in Unity 3 (I'm not sure), in 2.x at least you might find syncing events with music accurately to be a little tricky. This has been discussed on the forums before, so I'd recommend searching the forums for e.g. 'music game' or 'music sync' and see what others have had to say about it.
Your answer
![](https://koobas.hobune.stream/wayback/20220613074620im_/https://answers.unity.com/themes/thub/images/avi.jpg)