- Home /
Networked Audio Listeners
Hey guys,
Were working on a Online FPS and were ran into a hiccup. how would you set up the Audio listeners in a networked game? would there be any way of creating multiple instances? because the first listener is fine, but as soon as someone else would join the game wouldn't it start complaining about there being too many audio listeners in the scene?
thz
Answer by Meltdown · Apr 07, 2011 at 03:04 PM
Remember that each 'client' has its own camera, and you'd probably want to attach the audio listener to that camera. An instance of each camera is only active per 'client' in the scene.
You only want one audio listener on each client, as you only want one camera.
There is no reason to create multiple instances of an audio listener that I can think of unless you need to switch between them for certain reasons.
But in summary each client is correct to only have one listener, which is instanced based on them entering your game scene.
Answer by Stephen 1 · Apr 07, 2011 at 03:12 PM
ohhhhhhh....so if i attach a audiolistener to the prefab used to spawn the player. then even if another player would log into the game, spawning there own audiolistener (creating 2 listeners in the game) that would be fine?
Yes, that is correct :)
Also in the future don't reply using the Add Another Answer button, add a comment to a post for clarification. Good luck.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Network Audio. Why doesnt max distance work over network? 0 Answers
Sending an RPC back to its original sender 4 Answers
Getting Unity to listen to desktop audio 2 Answers
Network Error 0 Answers