Global Layers and Include Event Sheet

0 favourites
  • 4 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • I'm having sort of a problem with the functionality of my game. So I have buttons to move between screens which are all on a single layer. This layer is global obviously because I need the same buttons on every screen. The problem is, maybe because the layer is global, and that makes the objects on it the same instance, when I click on the spot where the button is on the screen on one layout (the button is not appearing, it's layer is invisible), the screen still changes to the layout of the button in that supposed position.

    Example:

    Layout: Game

    Layer "Screens" is Invisible

    Click the spot where "Menu" button (layer: screens) is supposed to appear

    Goes to Menu screen

    I am almost sure it is not a problem on the code, because that would be the way I would have done it in any other situation, does anybody have any clue?

  • Invisible objects, and objects on invisible layers are still clickable. You need to add another condition to your "On Button clicked" event -

    System Layer "Screens" is visible

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried, but thats the thing, maybe because the layer "Screens" is global, in some other layout it is considered visible, so it would kind of bring that visible from the "Menu" layout to the "Game" layout, and then just see that I tapped on the spot where the button would appear, and go to another layout.

  • Hey, yeah, never mind, that was enough, I don't know why cause I had tried it before but I guess I might have missed something on the code. Anyways thanks for the suggestion!

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