gotolayout and layer visibility not working

0 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Can anyone tell me why when going from one layout to another, setting a layer to invisible does not work.

    Here is the set up:

    layout story - has several layers. one is called "intro" on is called HUD

    layout review

    the story layout has some animations and events going on. At the end we click to go to review layout.

    I get a menu slide in by clicking a button from HUD.

    This menu has several buttons. Each one send you back to the layout 'story' but now I want the layer intro not showing and be deactivated.

    I tried the code on the review layout event sheet and i tried the code in story layout event sheet since it is HUD global variable I think it does not make any difference.

    The code on HUD buttons is:

    gotolayout story

    hide layer intro

    deactivate intro group

    set player x position to 300

    Unfortunately it goes to layout Intro but does not hide the layer intro.

  • You need to go to the layout, and then 'On start of layout', do the rest of the commands. You can't affect the other layout - you have to go there first.

  • I just saw your answer. So I guess it does not work when you are using one event sheet for all the layouts.

    You will always need to have an event sheet for each layout for some code that is very specific like go to layout and on start of layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's the easiest/cleanest way, but you can also use System.LayoutName to get the current layouts name, to do specific code that way.

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