Police/Fire/EMS Radio
-
What do you want to achieve? I am trying to make it so players can be on a specific voice chat channel to hear each other while players not on the channel will not be able to hear them.
-
What is the issue? I do not know how to achieve this nor have I seen anyone else achieve this either.
-
What solutions have you tried so far? I have seen similar post about this, However none of them have a clear solution to accomplish what I am trying for.
Background Context:
This would be like a police radio, where if a person holds down a certain key other people on the police team would be able to hear this person talk. I am not asking for a full on code to be written I am just wondering how I could go about with this.
I recommend you try looking at this article. I don’t know much about voice chat, but you can set listener perspective, so whenever a person chats, you can probably put the perspective of the chatter/listener at the position of the users head, and if they’re on the different radio, you can change the position of the user perspective to extremely far away like 1 million studs above the map so they can’t hear it. There’s no voice channels using VoiceChatService, so this is the best workaround I can think of.
You can adjust how a user perceives voice and all other sounds within your experience by calling SetListener(). The SoundService listener determines the point from which users hear audio within the experience.
When you use an ObjectPosition ListenerType, users perceive sound through the position of the object while using the orientation of the camera. The sound comes through their device’s left and/or right speaker depending on the orientation of the camera while the volume depends on the object’s distance from the source of the sound.
Source - Chat with Spatial Voice
5 Likes
I will definitely look into this and update you when I get home today to test it out.
2 Likes
I have absolutely zero clue if it will work, as I haven’t messed around with voice chat too much, but I wish you luck!
2 Likes
Yep, I have never touched voice chat either, just trying to learn some stuff before I start so I have a good plan, thank you for the help I do appreciate anything I can get.
1 Like
It seems to be like setting the listener impacts the place from which the player is listening to all sounds, meaning any other sounds in your game would be messed up.
When you say radio, are you looking for a long-distance radio system where police can hear each other from anywhere on the map? Or to restrict voice chat so you’re only talking to other police in close range, and nobody else can hear you?
If you’re looking for the former (basically a classic radio system), I remember some discussion that it can be done by locally setting the speaker’s head to be attached to the player (and making it invisible); this allows the player to hear the speaker talk even if they’re on the other side of the map. You could use a keybind to act as a transmit button, where when the button is pressed, it has listeners move the head to them.
For the latter option, already discussed the downsides, but the solution the other guy provided would work…
1 Like
I am talking about a long distance radio. I think what I might end up doing is making it so when a player is holding down a button it sets off a remote event which on the local side of anyone on the police team makes it so that players voice can be heard anywhere on the map. That might be the best way of doing it with how Roblox currently has stuff set up.