Motion Blur Script

Introduction

Hello developers! I was bored this morning and decided to try to make a motion blur script. Not only does this one work well, it’s also more compact that most other motion blur scripts on the toolbox.

How to use
First off, make sure you have inserted a blur effect into lighting. Next, find StarterPlayerScripts and insert a local script. Finally, paste in the code below.

local lv = Vector3.zero

game:GetService("RunService").RenderStepped:Connect(function()
	local x,y,z = game.Workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ()
	x,y,z = math.deg(x),math.deg(y),math.deg(z)
	
	game.Lighting.Blur.Size = math.clamp((Vector3.new(x,y,z)-lv).Magnitude/2,2,10)
	lv = Vector3.new(x,y,z)
end)

How it works
It works by comparing the rotation of the camera from the last frame to the current one and scaling the blur effect’s size accordingly.

Conclusion
In all, it works. Tbh, it literally took me like 15 minutes to write this script but I hope this helps someone. Thank you for your time!

43 Likes

Thank you very much! (character limit)

1 Like

Make maybe a showcase of it ? :thinking:

1 Like

I usually tried it. I’ll send it here later. I’ll just use Roblox default one

robloxapp-20221027-2330548.wmv (1.5 MB)