BindToRenderStep Error

Im trying to bind a function to renderstep with a argument in the function but it keeps saying argument 3 is missing or nil

local function Sound(s,obj,obj2)
	local music = s:Clone()
	for i,v in pairs(obj:GetChildren()) do
		if v.Name == "Speaker1" then
			music.Parent = v
			music:Play()
			print("Playing for "..obj.Name)
		end
	end
	rs:BindToRenderStep("Vis", Enum.RenderPriority.First.Value,Visualizer(music))
end
rs:BindToRenderStep("Vis", Enum.RenderPriority.First.Value, function()
    Visualizer(music)
end)

Basically, you are calling the function and passing its result to the method :BindToRenderStep. But your function doesn’t return a function hence the exception.

1 Like

It saying theres a syntax error

image
EDIT : wait forgot to add the end