(solved)How do I do event that can happen only once?

  • The problem is here:

    I have boxes that are dropping down on any object that is in family. When box is colliding with any of the family items, it will create dust particle cloud. But because of physics, sometimes the box is bouncing and creating actually multiple particle clouds which is not what i want. So how do i prevent the particle cloud appearing ever again except at the first time when box is colliding with something?

  • you might want to set a boolean variable on impact..

    on collision

    if boolean is not true

    create particles

    set boolean to true

    I guess you should decide under what conditions you want the particle effect to reappear again..

    maybe a timer, maybe when the box has stopped moving..

    at that time set the boolean back to false to have the possibility of particles again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Huh, that's first time i ever hear about boolean variables. I need to do some research.

  • That worked very well and was an easy solution.

    I did not know how to check if the variable is false, so i needed to check if its true and then change it to false, but that's not a big deal.

    So my solution was like that:

    on collision

    box has boolean variable set true ->

    Create particles

    set boolean to false

  • To invert events right-click the event and select invert..

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