Hello again.
Long story short:
Each player in my game could potentially fire their weapon at the same time. Currently, I have one sound bound to the firing event, and I update the position of the sound to the point of fire before triggering the event.
The problem is obvious: if everyone fires their gun at just about the same time, the sound is moved to the last position to be processed. Stranger behavior happens if a new fire event happens mid-shot of another. The sound "jumps" to the new position before it finishes playing.
The solution (at least what I have thought of so far):
Make a copy of the sound that I have for each player and update their respective sound on their shot.
The questions:
- Is this a logical/common solution to this problem?
- How do I handle the binding of events using the SoundPool? I’ve attempted the above solution, and the problem seems to persist (the sound jumping around). Wouldn’t the hashing function try to bind all these different sounds to the same, common resource?
- How have you guys handled this scenario in your projects?
Thanks.