Camera Motion Blur Script

Hi, just wanna get something out there that can maybe be useful.

Here’s the script:

local Camera = workspace.CurrentCamera
local BlurAmount = 10
local BlurAmplifier = 6	
local LastVector = Camera.CFrame.LookVector
local MotionBlur = Instance.new("BlurEffect", Camera)
local RunService = game:GetService("RunService")

workspace.Changed:Connect(function(Property)
	if Property == "CurrentCamera" then
		local Camera = workspace.CurrentCamera
		if MotionBlur and MotionBlur.Parent then
			MotionBlur.Parent = Camera
		else
			MotionBlur = Instance.new("BlurEffect", Camera)
		end
	end
end)

RunService.Heartbeat:Connect(function()
	if not MotionBlur or MotionBlur.Parent == nil then
		MotionBlur = Instance.new("BlurEffect", Camera)
	end

	local Magnitude = (Camera.CFrame.LookVector - LastVector).magnitude
	MotionBlur.Size = math.abs(Magnitude) * BlurAmount * BlurAmplifier/2
	LastVector = Camera.CFrame.LookVector
end)
6 Likes

Can you please provide some screenshots / a video?

4 Likes

Why are you making a new BlurEffect Instance every time there’s a new camera? That’s unecessary, whereas you can just put one BlurEffect in lighting and it’ll work no matter what camera.

2 Likes

This isn’t that of an efficient way. You could check when the Camera CFrame is changed and then, add a BlurEffect with really low size and delete it after like 0.1 seconds or something like that.

2 Likes