My field of view in the game is removed so that the sounds do not pass to the camera location. How do I change the camera to a character so that the sound touches him?
What?
In my game, the camera is far away from the character, very far away. And the sounds, such as a grenade explosion next to the player, will not be heard, since the camera is far away. How do I change the sound reception from the camera to the player?
Do you want it to be a global sound? If so, just parent the sound instance to something other than a BasePart and it will play globally (meaning the volume won’t change depending on whether you are closer or farther to a part)
I tried to make sound playback in workspace, but I recently realized that the larger the map, and the more players there are on it, the more unbearable it will be to play on it if the sounds are global. Someone opened the door at a distance of 1000 and others heard, although not at all nearby…
I asked the bot assistant at roblox a question, and he gave me this answer. Can you tell us more about this? I’m a little confused about what he wants from me…
Regenerated response: How to hear sounds from character instead of camera?
To hear sounds from a character instead of the camera in Roblox, you can use positional audio. Positional audio allows you to create audio sources that are tied to specific positions within your game world.
Here’s how you can achieve this:
- Create a Class.Sound object: In Roblox Studio, insert a Class.Sound object into your game world. You can find this object in the Explorer window under the Workspace or any other desired parent object.
- Set the Sound object’s properties: Select the Sound object and adjust its properties in the Properties window. You can set the SoundId property to the ID of the audio asset you want to play. You can also set other properties like Volume, Pitch, and Looping according to your preferences.
- Parent the Sound object to the character: To ensure that the sound plays from the character, you need to parent the Sound object to the character’s HumanoidRootPart. You can do this by dragging the Sound object onto the HumanoidRootPart in the Explorer window.
- Adjust the sound’s position: By default, the sound will play at the position of the HumanoidRootPart. If you want the sound to play from a specific point on the character, you can adjust the position of the Sound object within the HumanoidRootPart.
- Test the sound: Play your game and move the character around to test if the sound is playing from the desired position. You should hear the sound coming from the character as you move around in the game world.
By using positional audio and parenting the sound object to the character, you can create an immersive experience where sounds are coming from specific positions within your game world.
It’s very hard to understand what you want. There is no default behavior of sound “playing from the camera”.
The way sound objects work is that if they are parented to a basepart then it will play from that basepart. For example the default oof sound is parented to HumanoidRootPart by default. That way when the character dies there is an oof sound coming from the character. If you want other sounds to come out of the character you can parent other sounds to HumanoidRootPart.
You can use the Sound properties to change how far away you can hear the sound. For example RollOffMaxDistance.
I’ll give you a rough explanation of the reason for my question… I moved the camera 1000 steps away from the player and changed his FOV so that the picture was better visible in 2D dimension. Now when another player dies next to me, I can’t hear him. I set the sound distance to the one I needed, yes, Roll Distance helped me, but now when I walk away from the sound, it does not disappear
I attach a photo, I get such a 2D image when I move the camera far away and zoom in on the FOV. But because of this, the sounds do not reach the camera. Roll Max Distance is difficult to set up since I have been suffering for a day and picking up the numbers, but nothing comes out.
Okay I figured out what is happening. It is called the “Sound Listener” what you want to change. By default it is the camera. You want to change it to the character.
This method is what you need to use.
You will use this:
SoundService:SetListener(Enum.ListenerType.ObjectPosition,Character.HumanoidRooPart)
FOR THE FUTURE, EVERYONE!! TO HEAR SOUNDS NOT FROM THE CAMERA BUT FROM THE PLAYER, YOU NEED TO DO THIS:
local SoundService = game:GetService("SoundService")
SoundService:SetListener(Enum.ListenerType.ObjectPosition, player.Character:WaitForChild('HumanoidRootPart'))
AND SET FOR THE SOUND YOU WANT TO HEAR NEXT TO THE PLAYER:
ROLLOFFMAXDISTANCE = 70
ROLLOFMINDISTANCE = 7
ROLLOFMODE = INVERSE
Yeah, actually, that’s not necessary, it’s an optional thing that (really) helps a lot.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.