Hello! I’ve recently got back into LUA scripting and I was trying to make a motion blur script.
I think my script works pretty well, but I’d like to know people’s opinions on it and ideas on how to improve it.
I thought I could improve it by making it slowly fade in instead of appearing instantly, but I’m not sure on how to do that. Opinions, ideas and improvements?
local context = game:GetService("ContextActionService") local blureffect = game.Lighting.Blur savex = 0 savey = 0 function blur(x,y) if x ~= savex or y ~= savey then blureffect.Size = math.abs(savex - x + savey - y) else blureffect.Size = 0 end savex = x savey = y wait(0.01) if savex == x and savey == y then blureffect.Size = 0 end end context:BindAction("CameraMovement", function(_,_,input) blur(input.Delta.X,input.Delta.Y) end, false, Enum.UserInputType.MouseMovement)