How do you remove blur from CurrentCamera?

I added Blur to the player’s screen when the menu is on their screen. When they click the play button, the blur is supposed to be removed. However, it wasn’t removed for some reason and I don’t understand why. I used three scripts and a remote event (to remove the blur) because I don’t know how to get the player’s camera through a local script.

script #1:

local TweenService = game:GetService("TweenService")

local plr = game.Players.LocalPlayer

local TitleGUI = script.Parent.Parent.TitleText
TitleGUI.Position = UDim2.new(0.245,0,0.355,0)

local PlayButton = script.Parent
PlayButton.Position = UDim2.new(0.389,0,0.518,0)

local hasClicked = false

script.Parent.MouseButton1Down:Connect(function()
    if hasClicked == false then
	    hasClicked = true
	
    	TitleGUI:TweenPosition(TitleGUI.Position + UDim2.new(0,0,-1,0))
	    PlayButton:TweenPosition(PlayButton.Position + UDim2.new(0,0,1,0))
	
	    game.ReplicatedStorage.RemoteEvents.RemoveBlur:FireServer(plr)
   end
end)

script #2:

local RemoteEvent = game.ReplicatedStorage.RemoteEvents.RemoveBlur

RemoteEvent.OnServerEvent:Connect(function()
    local camera = workspace.CurrentCamera

    camera.blur.Enabled = false
end)

script #3:

local blur = Instance.new("BlurEffect")
blur.Name = "blur"
blur.Parent = game.Lighting

blur.Size = 15
blur.Enabled = false

local camera = workspace.CurrentCamera

game.Players.PlayerAdded:Connect(function(player)

local clonedBlur = blur:Clone()
clonedBlur.Parent = camera
blur.Enabled = true

end)

EDIT: NVM I made a mistake, I see that you are instancing the Blur on the server. Why not instance it on the client?

Anyways to test it, print something in the function that disables the blur. See if the function is ever called.

1 Like

I don’t really know where to instance it.

I don’t know how to get the player’s camera through a local script.

You can only get a player’s camera through a LocalScript. Your script #3 is fundamentally flawed: Workspace.CurrentCamera is how you get a player’s camera in a local script. It’s basically meaningless in a server script.

edit: also, I agree with @Redridge. This is a visual effect – it should be done on the client. No need for remotes in this case.

2 Likes