Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make a smooth transparency transition?

I know there's a simpler way to do this, but I don't know what to search to get an answer. Here's my script:

local base = game.Workspace.Part 
while true do 
	base.Transparency = 0
	wait(.1)
	base.Transparency = 0.25
	wait(.1)
	base.Transparency = 0.5
	wait(.1)
	base.Transparency = 0.75
	wait(.1)
	base.Transparency = 1
	wait(.1)
	base.Transparency = 0.75
	wait(.1)
	base.Transparency = 0.5
	wait(.1)
	base.Transparency = 0.25
	wait(.1)
end

How can I make this shorter and give it a smoother transition?

1 comment

3 answers

TweenService is the probably the best option as far as smoothness

well if you wanna make it shorter and smoother you can do:

local base = game.Workspace.Part 

repeat
	base.Transparency = base.Transparency + 0.1
	wait()
until base.Transparency >= 1

wait(However long)

repeat
	base.Transparency = base.Transparency - 0.1
	wait()
until base.Transparency <= 1

6 comments

0

though this as sometimes failed for me so be careful, then again i just did till part.Transparency == 1 instead of >= 1

0

Think I got it working, thanks bro!

0

Np

0

if you can. please do accept my answer, you do seem new to this

0

Yeah how do I do that? and sorry i am new lol

0

it should be at the bottom of my answer, report and a few others

for i=0, 1, 0.25 do
	base.Transparency = i
	wait(.1)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.