Fading Parts - saSlol2436DEV/FE2-Module-Documentation GitHub Wiki

How to fade an object

Since I have mentioned fading parts, how can you fade parts in the module? First, we need to reference the module.

local fe2Module = require(2100264088)

We need to type this line of code to get our useful functions. Okay, now, we need to use the function FadeObj(). Let me explain what we need to do.

Since the module doesn't know what part or what color it needs to fade, it needs inputs called arguments. These goes inside the parenthesis

We want to fade the part named Baseplate to white, so, we need to type the full hierarchy to reference it. We want it to fade to white, so, we will type in Color3.fromRGB(255,255,255) OR Color3.new(1,1,1).

local fe2Module = require(2100264088)

local whiteBaseplateFade = fe2Module:FadeObj(game.Workspace.Baseplate,Color3.fromRGB(255,255,255))

But that's not done yet, we still need to play this fade.

local fe2Module = require(2100264088)

local whiteBaseplateFade = fe2Module:FadeObj(game.Workspace.Baseplate,Color3.fromRGB(255,255,255))

whiteBaseplateFade:PlayFade()

That is how you play the fade.

Other fade functions

StopFade() and PauseFade()

StopFade() pretty much stops the fade. You can play the fade with PlayFade() but it will start again with the original color the part had in the beginning. When you use StopFade(), this means that the fade has completed.

PauseFade() stops the fade but it will keep its current color. You can continue the fade with PlayFade(). It will NOT make the fade completed and PlayFade() will continue on with its current color

WaitForFadingFinished()

WaitForFadingFinished() takes two optional arguments, the first one is the tween it is waiting for and the second one is what we call a callback function.

... -- These are eclispces. I use them to say that there is code above the code I have shown

local whiteBaseplateFade = fe2Module:FadeObj(game.Workspace.Baseplate,Color3.new(0,0,0))

local blackBaseplateFade = fe2Module:FadeObj(game.Workspace.Baseplate,Color3.new(1,1,1))

whiteBaseplateFade:PlayFade()

wait(5)

whiteBaseplateFade:StopFade()

blackBaseplateFade:WaitForFadingFinished(whiteBaseplateFade.Tween,function() whiteBaseplateFade:StopFade() end)

.Tween is pretty much the current tween. This is useful for certain cases.

⚠️ **GitHub.com Fallback** ⚠️