Issues with GunSounds playing too late

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A simple gun system

  2. What is the issue? Include screenshots / videos if possible!
    I press on the mouse to fire, the gun does fires, however as you can see in the following video, the shot noises arrive 0.5-1second after the bullet got fired, even tho when running the code, the sound should arrive first and then the bullet appear (or at least the sound and spawn of the bullet should be at the same time)

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried looking up multiple posts on devforum, and most are about preloading the sound to then clone it, parent it to a sound origin and play it from there. That’s exactly the method I am using but as you can see, it’s not working out as intended (yes yes, sound plays, however reminder that it’s supposed to play at the same time the bullet shoots out, not after, that just takes away from the gameplay immersion)

Concerned snippets of my code (the client: side/local script):

--During the creation of the weapon, that gets made as soon as the weapon arrives in the inventory, meaning by the time you take it out to shoot everything's (animations and sounds too technically) are already loaded
self.PreloadedSounds = {}
self.PreloadedSounds.GunShot = self.Sounds:WaitForChild("GunShot"):Clone()

--During the code block/snippet where the gun shoots the projectile, a few lines before actually shooting the projectile:
self.PreloadedSounds.GunShot.Parent = barrel
self.PreloadedSounds.GunShot:Play()

self.PreloadedSounds.GunShot.Ended:Connect(function()
	self.PreloadedSounds.GunShot.Parent = nil
end)

Please any idea would be welcome, I really do not find any solution to this annoying issue (also it’s my first time working with sounds so there might be some crucial beginners rule that I’m somehow not finding online)

P.S.: Before I forget and go to sleep, here is the sound effect I took from the toolbox, it’s 1 second long

the ID: rbxassetid://1905367471
the link: https://create.roblox.com/store/asset/1905367471/Gun-Shot

i think the sound isn’t loading fast enough i dont have any other ideas besides maybe a debounce

1 Like

From what I’m hearing in the video it sounds like both the gunshot and the footsteps are delayed too. Maybe something is causing the sound to lag?

1 Like

maybe set the sounds time positon to 0.5, or 1, ( just like the number of how many seconds it delays ) example if it delays by 0.5 seconds, make the sounds time position 0.5

1 Like

I can’t believe such a small thing is what kept me awake until 2am :sweat:. Thanks a lot, absolutely worked out!

the issue wasnt a lag issue, it was that the sounds mp3 itself is delayed by 0.5 seconds, so setting time position to 0.5, skips those 0.5 of delay

1 Like