I have a problem with using Entity:EmitSound with weapons. I'm using it for custom weapon sound scripts created using sound.Add. They play fine when the player is standing still, however when walk and shooting the sound will cease to emit after its overlapped itself a few times, and will continue to emit after the previous sounds have stopped playing, rinse and repeat.
It should be noted that I don't even have footstep sounds played at all in my gamemode (they're blocked using GM:PlayerFootstep), so I really don't get why this is happening. Like I said, the sounds will overlap themselves just fine when you're standing still and firing the weapon.
Any help would be appreciated!
You're hitting the sound limit. You can prevent the sound from overlapping using a different sound channel that doesnt allow this. As far as im aware, you cant prevent overlapping without using the CHAN_USER_BASE sound channel. I don't think its a great idea however since if too many sounds overlap, fps tanks alot from my experience. Source/Gmod doesn't like it when oyu overlap a shit ton of sounds i suppose.
So the source of the problem was pretty dumb on my end. When adding my sounds I didn't properly set the channel variable of the sound data (I had it was chan = CHAN_WEAPON and not channel = CHAN_WEAPON). Making this change solves the issue.
But thanks for the response, it still lead me to the solution. I'll keep in mind the USER_BASE channel if I do want the sounds to overlap, but they sound fine for the time being.
Sorry, you need to Log In to post a reply to this thread.