I'm trying to make an object fade out at the start of a layout, but it instantly turns transparent from black after a moment at the start. There was no way I could find to subtract from the opacity value through one function, so I had to use a variable as a workaround.
Develop games in your browser. Powerful, performant & highly capable.
First off, don't use waits in repeats.
Repeats all happen in a single frame. Wait's don't delay events, only the actions following it.
You can try using the fade behavior or tween behavior instead.
To add to oosyrag's comment, your event #2 is a top-level event, it will run on every tick. I assume you only want it to run at the start of the layout? Then you need to create a sub-even under event #1 and move it there.
Here is how you properly use Wait in loops:
Repeat 100 times ... Wait 0.1*loopindex ... (put actions here)
But a much easier solution would be using Fade or Tween behavior on the sprite.
I'll try the fade behavior then, ty!