Forum Discussion
Anonymous
6 years agoMultiplayer App Background Music Syncing
I'm developing a multiplayer VR app in Unity with Photon. I want to have background music which is in sync for all players. But what's happening with what I've tried so far is that the music starts fr...
MikeF
6 years agoTrustee
So youve got the setup correct but you still need to sync the data contained within the object once the 2nd player joins.
Basic flow should be something like this:
1) session starts with master client, audio starts playing
2) 2nd player joins
3) master client sends rpc containing current time of audio clip playback
4) 2nd player recieves rpc, sets start time of the audio clip to match the recieved time stamp and begins playing
Id suggest using the onPhotonPlayerConnected() callback to initiate the rpc and target it towards the newly connected player so that anyone else in the room isnt affected by the sync since theres likely to be a small delay caused by network latency which would cause a small hitch in the audio for players that have already been synced
Basic flow should be something like this:
1) session starts with master client, audio starts playing
2) 2nd player joins
3) master client sends rpc containing current time of audio clip playback
4) 2nd player recieves rpc, sets start time of the audio clip to match the recieved time stamp and begins playing
Id suggest using the onPhotonPlayerConnected() callback to initiate the rpc and target it towards the newly connected player so that anyone else in the room isnt affected by the sync since theres likely to be a small delay caused by network latency which would cause a small hitch in the audio for players that have already been synced
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 10 months ago
- 2 months ago