TweenService Background transparency not changing

  1. What do you want to achieve? Slowly change frame background transparency then FireServer() event

  2. What is the issue? frame is not even visible when playtesting/playing

  3. What solutions have you tried so far? i tried using the good old

frame.BackgroundTransparency = 0.35
wait()

But it wouldn’t work either.

local guicount = script:FindFirstChild("LamLantern")
guicount.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local player = script.Parent
local humanoid = player:WaitForChild("Humanoid")
local TweenService = game:GetService("TweenService")
local frame = guicount:WaitForChild("Frame")
local morph = game.ReplicatedStorage.Lammy
local Goal = {}
Goal.Transparency = 0.35
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)


zone.localPlayerEntered:Connect(function(player)
	local morphed = player:FindFirstChild("Morphed")
	if morphed == true then return end
	if morphed == false then
	local tween = TweenService:Create(frame, tweenInfo, Goal)
	tween:Play()  
	tween.Completed:Wait()
	wait(2)
	morph:FireServer()
end
end)

The event fires the background frame doesn’t even appear (please note that the original bg transparency is 1 and i want it to slowly transition to 0.25)

2 Likes

Try changing it to
local Goal = {BackgroundTransparency = 0.35}

Nope that didn’t work either, the background still doesnt appear.

where is your script located to?
StarterPlayerScripts?

It’s in startercharacter actually. nvm.

This text will be blurred

1- Transparency should be BackgroundTransparency

2- your script:

You located guicount to PlayerGui if u want the frame first u need to locate the screengui then Frame
PlayerGui.ScreenGui.Frame

local guicount = script:FindFirstChild("LamLantern")
guicount.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local frame = guicount:WaitForChild("Frame") --error you must locate first the screengui then frame.

screengui

I tried relocating the lamcount screengui in startergui but it still wouldnt work regardless.

not startergui
StarterGui: is when a player joins the game clones the ui in it to PlayerGui

locate PlayerGui.

Is the screen gui enabled and the frame visible?

Yes it is enabled and frame is also visible.

can u screenshot ur StarterGui.ScreenGui.Frame?


image
As for size and position i want the entire frame to cover the entrie screen as sort of shiny spotlight.

Do any errors appear in the output window?

Nope none.

This text will be blurred

Try this:

local guicount = script:FindFirstChild("LamLantern")
guicount.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local player = script.Parent
local humanoid = player:WaitForChild("Humanoid")
local TweenService = game:GetService("TweenService")
local playergui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local morph = game.ReplicatedStorage.Lammy
local Goal = {}
Goal.BackgroundTransparency = 0.35
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)


zone.localPlayerEntered:Connect(function(player)
	local morphed = player:FindFirstChild("Morphed")
	if morphed == true then return end
	if morphed == false then
	local tween = TweenService:Create(playergui:WaitForChild("LamLantern").Frame, tweenInfo, Goal)
	tween:Play()  
	tween.Completed:Wait()
	wait(2)
	morph:FireServer()
end
end)

Getting this error now while trying to change parent

ok then undo that one and replace:

local frame = guicount:WaitForChild("Frame")

with:

local frame = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("LamLantern"):WaitForChild("Frame")

and see if it’s working. Don’t forget to change Transparency to BackgroundTransparency.

Worked! howevery is there any way to change the tween speed?

1 Like

yes TweenInfo.new(delay,options)
Example: TweenInfo.new(1) << u can change 1 to 0.5 , lower = more faster.

1 Like