Live show times not synced properly

Hi, I’m trying to make a concert stage with a live show that syncs lights to music. The main script for it is running on a LocalScript, but using wait() and task.wait() seem to unsync from the music. I’m also using for i loops for fade in and out animation. Is there a better method I can use to sync the graphics of the show to the song? Any help is greatly appreciated!

Are you performing the timing logic inside of a RunService function?

I am not. I’m just using task.wait(). Should I be using RunService?

If the timings are okay sometimes and then not others, or are different between clients, it may be worth tying it RenderStepped (if you are in a LocalScript) and using the deltaTime that is passed in to this function. It will allow for more consistent timing between clients (i.e. frame drops can be accommodated using the changes in deltaTime to slow/speed things up accordingly).

I am doing it in a LocalScript, yes. I had an idea, should I maybe run a repeat loop until the song’s TimePosition matches a certain time? It would be kinda tedious, but would it be more consistent at all? Someone else also suggested I try using os.time.

Yes you could, I used a similar method to check TimePosition when I was trying to tie effects to music. Most often than not though I found using math.random()/10 to offset the waits on the TimePosition a little the chaotic nature of the universe made the music and effects coalesce into being in time in the end. Not that that is any solid or founded solution, I just noticed it worked and ended up removing most of the TimePosition checks.

1 Like

Couldn’t you just directly read off of the sound’s ‘TimePosition’ property?

1 Like