Text Transparency Tweening

Hey Developers!

I’m creating an intro and one of the effects I’m trying to pursue is a smooth transparency effect fading in and out. and I was wondering how I can achieve an effect like it.

example: sNXvyKH4fi

2 Likes
local Info = TweenInfo.new(1)
local Tween = game:GetService("TweenService"):Create(GUI,Info,{TextTransparency=1})

Tween:Play()

Try and look around next time.

3 Likes

wow i was about to make one for him

Holy smokes man I was going to answer

local Text = --location
while true do
wait(0.1)
 Text.Transparency = Tex.Transparency - 0.1
end
1 Like

I don’t think a while loop is the right choice for text transparency effects, as theres no point for it to constantly run once it hits 0 + it will yield the thread. A for loop or tween service would be better.

1 Like

lol uh yes i agree with you ee

1 Like

You would use TweenService for this. TweenService:Create() takes TweenInfo which overrides the properties of a new Tween. These properties are explained here: TweenInfo

The example you gave is probably something like this:

local Label = script.Parent

local Info = TweenInfo.new(
	0.35,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	-1,
	true
)

game:GetService('TweenService'):Create(Label, Info, {
	TextTransparency = 0.6
}):Play()

Edit: https://gyazo.com/04a63e5c12b056a8fa34c17fcb97cebb

2 Likes

Try this to make a smoothly flashing text transparency.

local gui = script.Parent

local runService = game:GetService("RunService")

local speed = 1

runService.Heartbeat:Connect(function()

gui.TextTransparency = math.abs(math.sin(tick()*speed))

end)

You can make the flashing faster based off of how high the speed is. 1 is a pretty good start point.

1 Like