I got a sprite that should trigger an event on touch once, when a certain condition is met. For that I created a sub-event with the condition and the additional condition "Trigger once when true". However, every time I touch the sprite, it triggers the event and the subevent always gets considered "first time trigger". how can I make sure that an action is only triggered once, when I tap on a sprite, without creating a global bool for every of them? I use it a lot.
You will need the bool or a variable so you can make the condition false. If you have too many objects consider using a Family with a Family instance variable then you can use one event that applies to everything.
Develop games in your browser. Powerful, performant & highly capable.
To add to lionz suggestion. 'Trigger Once' means, trigger once when these conditions become true, not trigger once only ever. If the conditions become false again (in your case object not touching) then it will trigger again the next time.
Use lionz suggestion of a variable to keep track of if the trigger has been fired already.
On object touched
Is object Var_triggered=false
Trigger Once - Set object Var_triggered to True