I have a sound emitter, in an attatchment, in a basepart. It has some audios. When someone hits the proxy prompt, it swaps out the song. No issue there.
Except for the fact that no matter what I do, it just decides not to occlude, not to fall off, but to just play EVERYWHERE.
Here’s the script, and some images;
local emitter = container.Attachment:FindFirstChildOfClass("AudioEmitter")
local sounds = {}
local currentSound = nil
local textLabel = container:FindFirstChild("Billboard") and container.Billboard:FindFirstChildOfClass("BillboardGui") and container.Billboard:FindFirstChildOfClass("BillboardGui"):FindFirstChildOfClass("Frame"):FindFirstChildOfClass("TextLabel")
local prompt = container:FindFirstChildOfClass("ProximityPrompt")
if emitter then
for _, obj in ipairs(emitter:GetChildren()) do
if obj:IsA("Sound") then
table.insert(sounds, obj)
obj.EmitterSize = 10
end
end
end
local function getRandomSound(exclude)
local pool = {}
for _, sound in ipairs(sounds) do
if sound ~= exclude then
table.insert(pool, sound)
end
end
if #pool == 0 then return exclude end
return pool[math.random(1, #pool)]
end
local function playSound(sound)
if currentSound then
currentSound:Stop()
end
currentSound = sound
currentSound.Looped = true
currentSound.EmitterSize = 10
currentSound:Play()
if textLabel then
textLabel.Text = currentSound.Name
end
end
if emitter then
playSound(getRandomSound(nil))
end
if prompt then
prompt.Triggered:Connect(function()
local newSound = getRandomSound(currentSound)
playSound(newSound)
end)
end

I genuinely don’t know what’s going on here.