x


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. :)

more ▼

asked Oct 03 '10 at 02:58 PM

user-4347 (google) gravatar image

user-4347 (google)
29 11 11 13

(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

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.

more ▼

answered Oct 03 '10 at 07:39 PM

Jesse Anders gravatar image

Jesse Anders
7.3k 7 17 48

(comments are locked)
10|3000 characters needed characters left
Position += Speed * Time.deltaTime;
more ▼

answered Oct 03 '10 at 09:12 PM

IJM gravatar image

IJM
1.4k 2 5 19

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2090
x1095
x1029
x318
x156

asked: Oct 03 '10 at 02:58 PM

Seen: 1218 times

Last Updated: Oct 03 '10 at 02:58 PM