How to make a music synchronized game intro?

If a song is 200 beats per minute then a beat occurs every
200/60 = 0.3 seconds

How about adding a new letter every 0.3 seconds?

1 Like

Oh yea I already have the timings but they’re not exact with the BPM, 200BPM is the BPM of the entire song

btw 1 sec i’mma get my timings

1 Like

1.15s song starts
3.08s first letter A
3.12s second letter T
3.15s third letter M
3.22s 4th and 5th letter OS
4.08s logo disseapears
4.13s Menu appears

its all about the start and the end of the song, you have to see when the beats start and end and script the UI at the time the beats happen

i sound one of those teacher who teaches in the most hard way possible but this is the easiest way i can think of it

1 Like

If you want timings to be perfect, instead of counting frames you could save the current tick() when the song is played (which is the epoch time in seconds) and on every RunService.RenderStepped check to see if the difference between the new and old ticks is enough to trigger a timing, then reveal a letter if so. (use a debounce)

1 Like

Thanks, i’m going to start coding it later, if I have any more questions/problems i’ll respond to this reply

1 Like

Maybe a simple, and not so effecient way is to connect a function when the song starts, then wait(3.08) and here maybe Tween:Play() then wait(0.4) and so on. You can test this as I’m not sure if it’s really efficent or not.

1 Like

Could be a solution but wait() is not precise enough ( I heard that on a thread)

I think the easiest way for me is to find a way to count milliseconds precisely

And therefore I don’t think it’s really that efficent. Wait() is only 30/sec. So if you were to put some code that would run for 1 second in a loop and put wait(), it would only run it 30 times. The minimun of time you can wait is 0.03 seconds, but when it happens on the client and not the server, it should probably be effecient enough. Else, RunService.RenderStepped is another way.

1 Like

I checked on the roblox API Reference,

What’s better between RunService.Heartbeat or RunService.RenderStepped for an intro like this ?

Hi does someone know how TimePosition counts ?
like is 0.001 actually 1 millisecond ?
or it runs on 60hz ?

I made a studio intro for my development studio. In all of our games we have a little intro. The way I did it was I animated it, then put in the song/sounds. I played the game to watch the intro, then made required adjustments. I just played with the audio and animation until everything lined up.

1 Like

Was the animation a video or a series of instructions in a script ?

Series of instructions in a script. I just used tweenservice with some ui gradients.

Oh ok, last question how did you do the timings ? Did you use wait(n) or something else ?
I just need this part lol

I used wait, or made the tween take a certain amount of time.

Oh ok then but did you have problem when using wait() ? I’m trying to be as precise as possible

I used a sound effect, then used wait and tweens with an image label. That was my whole intro.

Oh then i’ll probably need something more precise, but thanks anyway !

1 Like

Ok i’m back, i’m planning to compare the sound instance’s timeposition value with an exact timeposition value, but how could I detect when they’re the same ?