How would I tween a blur effect when a player spawns?

I want to tween in a blur onto a player’s screen when they spawn, so it blurs the background before they press play.

When they press play, the blur should tween out.

The scripts i currently have are:

local script in starterplayerscripts

game.Players.PlayerAdded:Connect(function(plr)
	local Info = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
	local TweenService = game:GetService("TweenService")
	local goal = {Size = 56}
	local TweenBlur = TweenService:Create(game:GetService("Lighting").welcomeBlur, Info, goal)
end)

localscript inside the play button

local button  = script.Parent
local blur = game.Lighting.welcomeBlur
local ts = game:GetService("TweenService")
local Info = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local TweenBlur = ts:Create(game:GetService("Lighting").welcomeBlur, Info, {Size = 0})

button.MouseButton1Click:Connect(function()
	TweenBlur:Play()
end)
1 Like

Are there any errors in the output?

no errors are in the output,
it just doesnt tween the blur at all.

this is the setup of my lighting
image
so i know it should work since the welcomeblur is there

the issue is that if the local script is inside of the starter player script u dont need to add the players added event

i’ve tried the script in startercharacterscripts and without the player added event in both of the startercharacterscripts and starterplayerscripts and it doesn’t work

try to add the wait for child function to the blur effect, so the client can wait the blur to load

i’ve tried that and it made no difference

ok so can u send your code pls?

i sent it in the original post…

local Info = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local TweenService = game:GetService("TweenService")
local goal = {Size = 56}
local TweenBlur = TweenService:Create(game:GetService("Lighting").welcomeBlur, Info, goal)

TweenBlur:Play()

You never played the tween.

4 Likes

omg im so stupid

thank you so much

1 Like

No problem.
One more thing, you may need to make the duration of the tween longer as the ROBLOX loading screen may block it.

1 Like

yeah i’m editing the tween duration now, thanks