Help with a fade in and out label

I need help with a label that fades in and back out when the player passes a certain place in the level. My way is so complicated that I can’t even find the issue.

It’s simple, yet so complicated.

My code doesn’t count both coordinates, it activates on only 1.

1 Like

If (playerX == triggerX){
Label Alpha = 100;
Something like that? Seems pretty simple to do in Flowlab.

Expression + Filter

If playerX - triggerX == 0, label alpha = 100

1 Like

I know, but it’s not. I made it work, but I still know there’s a simpler way to do it. Virus Apocalypse Here’s the link.

Ooh, I never use that. That’s probably the problem. I’m still learning how to use expression.

If you can find a better way to do it, I’ll give you the solution.

1 Like

would this work?

1 Like

Ooh, you would use X from the trigger. Sadly, the trigger is just an invisible piece of level. I’ve never thought of that. Smart.

Also, I need the label to fade in and out. That’s why my code is so messy. Also, it’d have to be the X and Y of the trigger to make sure that it doesn’t activate at random times.

I’ll save this idea though, it might come in handy… use both the player coordinates and the trigger coordinates.

1 Like

You could just use the x coordinate of the location you want it to trigger at, extractor just makes it a bit easier since you don’t have to figure that out.


Ok, I might try that. Thanks for the information! Do you know of any easy way to make the label fade in and out?

1 Like

Use the Ease block. That’s kinda its whole purpose, to move between 2 numbers smoothly.

1 Like

I still have much to learn.

(I have no idea how to use the expression, ease block, or a bunch of other things.)

1 Like

You might also consider setting the expression to

Math.abs(A) Math.abs(B)

And the filter to less than maybe 5-10 or something???

This will make some extra buffer, just in case the object is moving pretty fast and never reaches that exact X value, just “hops over it”, so there’s a small buffer… Probably not nessicary, but if it doesn’t work, it might be because of that