Question about changing to another layout

0 favourites
  • 5 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I'm trying to create an event in which the layout changes when the instance variables on some objects reach a certain point. Here is an image of what I currently have:

    What I'm trying to achieve is when the health instance variable on these sprites reach less than or equal to zero, the layout changes. But for some reason the layout doesn't change. Is there something I'm missing?

    Thank you for your time and for reading this.

  • Should all 3 health variables be 0 or less, or just any one of them?

    If any of them, you need to change your event to Or-block (select entire event, right click -> Make Or-block).

    I also suggest running your game in Debug Mode, you'll be able to monitor all objects, variables etc.

  • Should all 3 health variables be 0 or less, or just any one of them?

    If any of them, you need to change your event to Or-block (select entire event, right click -> Make Or-block).

    I also suggest running your game in Debug Mode, you'll be able to monitor all objects, variables etc.

    All 3 health variables should be 0 or less in order for the layout to change.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so run the game in debug mode and check all 3 objects and their Health instance variables.

    If all objects exists and all three Health variables <=0, but the layout is still not changing, it means the code on your screenshot is not getting executed. Is it part of some parent event, or an events group that could be disabled?

    Try adding Browser object to your project, and insert Browser-Log "some text" into this event. Open browser console when running your game to see if this event gets triggered.

  • I did a little bit more tweaking with other events and figured out the problem. There were other events that I forgot would affect those instance variables, which is why it wasn't changing. Thank you so much for your time and attention though!

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