[SOLVED] How do I Restart a layout from another layout

0 favourites
  • 8 posts
From the Asset Store
In this template the music plays without looping in your game
  • Is it possible to restart a layout from a different layout?

    My problem is that after my player dies I have a function (see picture)

    but the problem is after my functions are activated if my player presses the button to go to the main menu and then goes back to the game layout, then the functions are still active, for example the bullet behaviours are still disabled, the player will not move but if I could restart the game layout from my menu layout then everything would be reset again.

    Does anyone have any ideas or solutions

    Many thanks

  • You are probably using global variables which are not reset..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can't. Basically if you switch from layout A to layout B then layout A do not exist anymore. Everything on that layout (if not set to global) is destroyed and unloaded from memory.

    "if my player presses the button to go to the main menu and then goes back to the game layout, then the functions are still active"

    hard to tell without looking at your events, but this should not have happened. If you create a bullet (behavior ON by default) on game layout and set its behavior to OFF by some event then when you go to main menu this bullet don't exist anymore (if it's not set to global).

    what you are saying here look like your player is a global object, and if that's true then you will need to manually reset all of his states, behaviors etc.

  • LittleStain shinkan thanks for your help, it appeared to be the groups in the function not resetting so I copied all the groups from the function and went to the title layout and pasted them under the button and changed them from disabled to activated

  • Hi,

    Could you please tell me how to paste events in the comment box as you did?

  • Hi,

    Could you please tell me how to paste events in the comment box as you did?

    you mean how to show an image on the forum?

    upload your image to the internet somewhere and in the full editor put the link between the

    -tags

  • True. Groups and layers do not resets.

  • > Hi,

    > Could you please tell me how to paste events in the comment box as you did?

    >

    you mean how to show an image on the forum?

    upload your image to the internet somewhere and in the full editor put the link between the

    -tags

    Thanks

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