How to restart a game/layer.

This forum is currently in read-only mode.
  • I am new to construct and i could not find how to restart the game/layer. Please help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use goto layout and got the name of the current layout.

    So if you layout is named "Layout 1", use this action:

    -> System: Go to layout "Layout 1" with transition "None" lasting 0 MS
    [/code:2l7wb336]
  • I did this, but when I go to the same layout (or any other layout) I have a crash. The game freeze. Maybe because I'm using phyhics and there is a bug with that?

  • It works for me when using the physics behavior. What other objects/Behaviors are you using? Also if you post a cap that will make it easier to figure out the reason for the crash.

  • The workaround I would use is this:

    Make a global text variable, named like LayoutToGoTo for example.

    Make a new layout, named LayoutRestarter for example. In this layout, have just one event, something like:

    Start of layout: Go to layout global('LayoutToGoTo')

    So, to restart your current layout, you could set the global variable's value to the current layout's name, then go to the layout LayoutRestarter.

    To get the current layout's name, it is.. somewhere in the system object. CurrentLayout ? LayoutName ? I forget.

  • I don't know why. Now with this version 85 (instead of 84) I re do the project and

    now the game works! Seem that I can switch between the layers without difficult!

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