-
What do you want to achieve? Keep it simple and clear!
I want to set the sound range of a sound instance. -
What is the issue? Include screenshots / videos if possible!
The issue is that RollOffMaxDistance and MaxDistance doesn’t work. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried RollOffMaxDistance and MaxDistance
-- Modules
local Config = require(script.Parent.Parent.Modules.Config)
-- Tool
local Tool = script.Parent.Parent
-- Anim Folder
local AnimFolder = Tool.Animations
-- Sounds Folder
local SoundFolder = Tool.Assets.Sounds
-- Animation Instances
for i,v in pairs(Config.Animations.SlashAnimations) do
if not v.Enabled then continue end
local Anim = Instance.new("Animation")
Anim.Parent = AnimFolder
Anim.Name = i
Anim.AnimationId = v.AnimationId
end
for i,v in pairs(Config.Animations.OtherAnimations) do
if not v.Enabled then continue end
local Anim = Instance.new("Animation")
Anim.Parent = AnimFolder
Anim.Name = i
Anim.AnimationId = v.AnimationId
end
-- Sound Instances
for i, v in pairs(Config.Sounds) do
if not v.Enabled then continue end
local Sound = Instance.new("Sound")
Sound.Parent = SoundFolder
Sound.Name = i
Sound.SoundId = v.SoundId
Sound.Volume = v.Volume
Sound.MaxDistance = v.MaxDistance
end