Fade away

Try itChanging how it looks

This slime wants to be a ghost. A good ghost can fade away, so let us start there.

Press Play

Press Play Play this script and watch. The slime fades until you can nearly see through it. It waits. Then it fades back in.

LineWhat it does
my opacity is 20 slowlyFades the slime out, down to 20.
wait 2 secondsGives the fade time to finish.
my opacity is 100 slowlyFades it back in, up to 100.

Why the wait is there

A slow change does not hold up the script. The slime starts to fade and goes straight on to the next line. Without the wait, it would start to fade back in before it had faded out.

Try some more

Press Blocks Blocks, at the top left of the code box. There you can type any number.

Try thisWhat happens
The first number as 0The slime fades away to nothing.
The first number as 60It only fades a little.
Take a look in Code CodeThe same numbers are in the words.

This section ticks itself when you press Play Play this script.

Press Play in the code box to finish this section.