A problem with my rhythm game

  1. What do you want to achieve?
    I want to make some sort of rhythm game that mainly uses call and response. I decided to follow a tutorial and changed some things to what I prefered.

  2. What is the issue?
    The test on straight 8th notes are inconsistent.

The beeping starts at 9 seconds

  1. What solutions have you tried so far?
    I tried many rhythm game related devforums and tutorials but those didn’t really help.

Any help will be appreciated!

We can’t really help you with anything until you provide us more context. What’s the audio ID, what’s the underlying script controlling it, etc.

1 Like

Yeah, sorry, here’s some of the code:

function Reader(MapName)-- Not using MapName right now
	local last = tick()
	local time = 0

	for i = 1, #requiredModule.notes do
		time = last + (requiredModule.notes[i][1]/1000)

		repeat
			RunS.RenderStepped:Wait()
		until tick() >= time
		
		coroutine.wrap(function()
			-- Makes sound
			if requiredModule.notes[i][2] == 1 then
				local Root_S = Instance.new("Sound")
				Root_S.Parent = LocalSounds
				Root_S.SoundId = "rbxassetid://9113880610"
				Root_S.PlayOnRemove = true
				Root_S:Destroy()
			end

			-- Then, Makes a ui note
		end)()
		
	end
end

Seems like the sfx has to load each time a note is meant to play? That could cause a delay. It can help to reuse a pre-loaded sfx instead of creating and destroying one every time it’s meant to play.

Thank you! I thought a playing sound and playing it over and over will make the sound start and stop each time. Well, now I know!

1 Like

No problem. I hope you are able to figure it out :+1:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.