I want to make an image fade out cilentside using Tweens via a local script. Here’s a pseudocode of what I had been doing so far and the error I had ran into:
local player = game.Players.LocalPlayer
local pGui = player:WaitForChild("PlayerGui")
local tweenS = game:GetService("TweenService")
local vFrame = pGui:WaitForChild("ViewportFrame").ImageTransparency
local function FadeOut(Image, Duration)
local Tween = tweenS:Create(Image, TweenInfo.new(
Duration,
EasingStyle,
EasingDirection,
), {Transparency = 1})
Tween:Play()
end
FadeOut(vFrame, 1)
Any help/advice would be appreciated and I will do my best to clarify as this is my first post on the forums.
You’ll need to Tween the actual object itself rather than the property “ImageTransparency”.
You could try doing this:
local player = game.Players.LocalPlayer
local pGui = player:WaitForChild("PlayerGui")
local tweenS = game:GetService("TweenService")
local vFrame = pGui:WaitForChild("ViewportFrame")
local function FadeOut(Image, Duration)
local Tween = tweenS:Create(Image, TweenInfo.new(
Duration,
EasingStyle,
EasingDirection,
), {ImageTransparency = 1})
Tween:Play()
end
FadeOut(vFrame, 1)