"the world's easiest question" but on to the question:
Using tweens to do this is cooler than this:
for i = 0, 1, 0.001 do
script.Parent.Transparency = i
end
To use it, let's set up a TweenInfo for the tween settings.
local info = TweenInfo.new(
Time = 5,
EasingStyle = Enum.EasingStyle.Quad,
EasingDirection = Enum.EasingDirection.Out,
repeatCount = 0,
reverses = false,
delayTime = 0
)
Now we'll set up a property table to change. It adds for certain property types like Vector3.
local propertyTable = {
Transparency = 1
}
Time to tween!
local myPart
local myTween = game:GetService("TweenService"):Create(myPart, propertyTable, info)
Now we can do alot of things, but we will only :Play it. To know more, look at this: https://developer.roblox.com/en-us/api-reference/class/Tween.
Full code:
local info = TweenInfo.new(
5,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
0,
false,
0
)
local propertyTable = {
Transparency = 1
}
local myPart
local myTween = game:GetService("TweenService"):Create(myPart, propertyTable, info)
myTween:Play()
That's it!
Links:
https://developer.roblox.com/en-us/api-reference/enum/EasingStyle
https://developer.roblox.com/en-us/api-reference/enum/EasingDirection
https://developer.roblox.com/en-us/api-reference/class/Tween
https://developer.roblox.com/en-us/api-reference/function/TweenService/Create
2 comments
Hyperlinked the links in the answer.
I tried to link them, but when I linked them, it linked to another page.