Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Local blur effect not working? [Solved]

I have a script that would enable a blur effect when the player dies. It works perfectly when i test it on studio, but when i test in game i get an error saying "Blur is not a valid member of Camera" Any idea why the game deletes it? This is a LocalScript by the way.

wait(1)
player = script.Parent.Parent.Parent.Parent.Character
hum = player.Humanoid

local blur = workspace.CurrentCamera.Blur
local color = workspace.CurrentCamera.Color
while true do
	wait(0.1)
	if hum.Health < 1 then
		blur.Enabled = true
		color.Enabled = true
		for i = 5,15,0.1 do
		blur.Size = i
	end
	else
		blur.Enabled = false
		blur.Size = 0
		color.Enabled = false
	end
end

SOLVED: Instead of placing the BlurEffect in workspace.Camera, i used

Instance.new("BlurEffect", workspace.CurrentCamera)

3 comments

0

Let me guess, ServerScript?

0

No, LocalScript.

0

Put it in Lighting.

1 answer

in localscript (works fine)


local cam = game.Workspace.CurrentCamera
Instance.new("BlurEffect", cam).Size = 40
wait(10) --for exemple

cam:Destroy() -- return to the default setting

This discussion is preserved as it was. New answers, comments, and votes are closed.