Object opacity in loop

Hello !! With a little help from chatgpt it didn’t work out as it should ; ] so I’m asking for your help. I’d like the “blue” object to flash after any of the units from the “blue units” group has crossed the center of the map until none of the units are on the opponent’s half. What can I do to make the flashing have a loop option until that moment? At the beginning the blue object opacity is 0.
Zrzut ekranu 2025-02-16 123937

This isn’t a simple one event solution. You have a few conditions to meet and different actions for each one. Here’s my solution:

@MrMen It works!! There is only one problem, when I set “wait” to 22 sec for creating the “air2” object at the beginning of the scene, it stopped working. I did a test and when one of the enemy units “mech1” or “air2” is missing, it does not work. When there are these units, i.e. “mech1” and “air2”, it works. I placed your event group at the very top, but it did not help.
“all player units” - tank
“enemies” - “mech1” and “air2”

“blueunits” - tank

Can you screen snip the beginning of scene events and the part where you change blue’s opacity?

@MrMen I have already removed the “wait” action but it will be in the future, the problem is that when the mech1 or air2 unit is missing (“toggle disabled” in events) then the blue object does not appear and does not flash when the tank crosses the center


@MrMen I’m not sure if the translator translated it correctly or if I understood you correctly, if you want another screenshot, tell me

No, those screen shots were fine.

What objects do you have in the blueunits? How are Air2 and Mech1 related to blueunits?

@MrMen in blueunits - only tank

Ok. How does the object “blue” get placed on the scene? Is it in the scene the whole time, or does it get created in events?

Also, is the game all on one screen? Or does the screen scroll around?

@MrMenthe blue object is on the stage all the time with opacity 0% at the beginning, the game plays without scrolling the screen, tank mech and air are create in the area1 layer



@MrMen when I click “toggle disabled” on the event group “air2” or “mech1” then the blue object does not appear, when I delete one of these event groups “air2” or “mech1” the blue object does not appear either, it turns out that these event groups must be there and they must be active

Then there must be events related to “air2” or “mech1” that cause “blue” to not show.

What layer is the object “blue” on? And is that layer visible or hidden?

@MrMen So, I tried to do something but it didn’t work and I started adding another cannon to the game, I set the parameters etc., and now it turned out that there don’t have to be two objects “mech1” and “air2” for the blue object to appear and flash but the condition is that there have to be 2 tank objects (from the blueunits group)! when one crosses the center, the blue one doesn’t appear but when the second tank appears on the map and the first tank has already crossed the center, the blue object appear and starts flash

Yes, that makes sense. Blue only flashes blue when a tank crosses and stops flashing when all tanks have crossed. With only 1 tank, both conditions are met at once and the flashing will not occur.

@MrMen ok so how to fix it?

You’ll have to change your rules for when blue flashes and when it stops.

I pasted a screenshot from gdevelop of your method to chatgpt and it solved the problem, he did it completely differently than you and it works! Anyway, thanks for the help @MrMen ! I appreciate it !

and I had to add this too
Zrzut ekranu 2025-02-18 162830