I am trying to add a simple blur effect whenever somebody respawns in a game. I’ve looked around the developer forum, but haven’t found an answer. I’ve tried making my own script, but it seems to not work. I think it has something to do with the tween part of the script, or the character added bit, since those are not my forte. Any and all help would be appreciated.
Code Listed Below
local blur = Instance.new("BlurEffect")
blur.Enabled = true
blur.Parent = workspace.CurrentCamera
blur.Size = 15
blur.Name = "RespawnBlur"
local player = game.Players.LocalPlayer
local TweenService = game:GetService("TweenService")
player.CharacterAdded:Connect(function()
wait(1)
local Tween = TweenService:Create(blur, 2, Enum.EasingStyle.Quad, Enum.EasingDirection.Quad, 0, false, 0, {Size = 0})
Tween:Play()
end)
Hi there,
your script has some errors. Firstly, Quad is not Easing Direction and you have to firstly add the TweenInfo.new() function to create a new tween. This is how the Script would look like:
local blur = Instance.new("BlurEffect")
blur.Enabled = true
blur.Parent = game.Lighting
blur.Size = 15
blur.Name = "RespawnBlur"
--
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0)
local Goals = {Size = 0}
local Tween = TweenService:Create(blur, info, Goals)
wait(5)
Tween:Play()
(You must add these lines to a local script in the starter GUI or starter player scripts for this to work).
NOTE: This script is local only, so when a player joins, the event will only fire for that player.
Hope this was helpful!
Hey! Your solution did happen to work! I had to iron out a flaw or two to both fix it and make it more towards what I want. The Parent of the BlurEffect should indeed be workspace.currentcamera and not in the lighting as to only show it to the player, also in general to just make it work. I also made it so that it causes this blur effect every time you respawn. Still, thanks a ton my friend! Much appreciation for your help!