How do I trigger an event once only?

0 favourites
  • 4 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • Hi,

    I have set a condition so that when score > 10 a notification will appear on screen as sprite. How do I make it so that it only appear once .. so that when the next time the player score more than 10 it won't appear again?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There may be a better way of doing it, but I'd just have a global variable that is set to 0, and change it to 1 when the event happens the first time. Check the variable every time the event gets called, and only do your event actions when the global variable is set to 0.

  • Thanks terrancd. It worked

  • Add the "Trigger Once While True" System condition to the event. It must be at the bottom of the list of conditions.

    It will trigger once, and only trigger again once the condition becomes false, then true again.

    Then to disable this, you could either keep it in a group and deactivate the group in the actions, or use a global boolean as previous suggested.

    I prefer to use groups for activating / deactivating bits of functionality.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)