What can't you do?
I want to be able to synchronize what sound is played from a sound event across all clients.
Right now when I play a sound event it randomly selects a sound to play, but if I trigger the playing of a sound via an RPC, I have no way of ensuring every player is hearing the same sound.
How would you like it to work?
I would like an API exposed like this
SoundEvent se = new SoundEvent(); // assume this is a real sound event
var chosenIndex = Game.Random.Next(0, se.Sounds.Count);
Sound.PlayExact(se, chosenIndex);
Essentially some variation of Sound.Play that allows me to specify an index.
OR, there is a networked version of Sound.Play which plays the same sound across all clients
What have you tried?
Some abomination like this
var handle = Sound.PlayFile(se.Sounds[chosenIndex], 1f, 1f, 0f, 0f);
handle.AirAbsorption = se.AirAbsorption;
handle.Falloff = se.Falloff;
handle.DistanceAttenuation = se.DistanceAttenuation;
// And all the other properties from sound event
Additional context
No response
What can't you do?
I want to be able to synchronize what sound is played from a sound event across all clients.
Right now when I play a sound event it randomly selects a sound to play, but if I trigger the playing of a sound via an RPC, I have no way of ensuring every player is hearing the same sound.
How would you like it to work?
I would like an API exposed like this
Essentially some variation of
Sound.Playthat allows me to specify an index.OR, there is a networked version of
Sound.Playwhich plays the same sound across all clientsWhat have you tried?
Some abomination like this
Additional context
No response