How do I make sound fade in and out depending on distance if it's in a model

I’m trying to play audio that starts to fade in or out depending on the camera’s position.

The audios are coming from a sword, which is a tool. This sword has a model inside of it, which is the sword model, and when the tool is in possession, the model is parented to the character.

The emitter properties in sound instances don’t work in models or objects such as parts parented in models. I’m not sure how to make sound disappear within a range inside a sword model.

As far as I know, RollOffMinDistance and RollOffMaxDistance doesn’t matter if it’s in a non-physical instance (like a Model,) it must be in a BasePart. If your sword has a handle part, put the audio in there.

Am I able to animate a sword that’s not in a model? Since my animation requires a sword to move with the animation.

Yes, you can, but what kind of animation is it? Is the sword animated by itself or is it animated with the character?

The sword is animated with the character.

In that case, you just have to set up a Motor6D with the hand (or arm, if it’s R6) and the sword handle.

Oh okay. I already had that set up.

Okay so since the handle needs to be parented to a characters bodypart, it’s still experiencing the same issue since the character is a model.

Is there a conflict that occurs when you put the audio into the handle, or is there another reason why you cannot put the sound into the handle?

I placed the audios into the handle, and it’s still the same issue as it was when it was in the sword model. I think it’s because the handle is parented to a part that’s in a model, which is the character.

I doubt that’s the problem, what are your rollOff min and max properties and rollOff mode?

max: 20, min: 10 I zoomed out to the max and the audio never changed.

The audios are in a folder, which is inside the handle.

Pling said it already, they MUST be in a BasePart

They must be parented directly to a basepart, not inside of a folder inside the part. If you want to parent them to something like a folder to keep your part organized, I recommend using an attachment inside the handle and parenting the sounds there.

Is a basepart related to something such as HumanoidRootPart?

A basepart is just a class including things like parts, meshparts, etc. Just real objects inside the game pretty much. A humanoid root part counts and you can parent audios there if you really wanted to.

You can’t use folders or models for sounds and have them fade in/out with distance since they aren’t actually parts in the workspace.

Okay thanks! I guess this applies to attachments since it’s a physical object.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.