Duplicate global object after switch layout

0 favourites
  • 6 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • object duplicate after switch layout

    I have a layer set to global then each layout has that layer override.

    And I have made an object "PlayerState" set to global.

    if I switch between layouts I can see "Object PlayerState" was duplicated with "debug layout".

    dropbox.com/s/5fx5skyegvub2e0/duplicate%20obj.c3p

    https://www.dropbox.com/s/5fx5skyegvub2e0/duplicate%20obj.c3p?dl=0

    update:

    for now, I use this to remove unwanted objects, but I feel it's kind of hacky.

    "system" -> "on start of layout"

  • Pick one of them only, global object or global layer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pick one of them only, global object or global layer.

    if I choose to disable "global object".

    the player state will not be preserved across the layout.

    the plugin like the ultimate inventory will not work.

    well "global layer" has another issue.

    UI layer doesn't present in each layout.

    so how to properly deal with this case?

    save player state with "on end of layout" then load state with on start of layout?

  • Depends what that object is used for, at the moment it doesn't do anything? A global layer is for something like a HUD that transitions between layouts and doesn't move, for this you don't need global objects but just put them on the layer. A global object is for something like the player that continues through each layout and retains its stats.

  • Depends what that object is used for, at the moment it doesn't do anything? A global layer is for something like a HUD that transitions between layouts and doesn't move, for this you don't need global objects but just put them on the layer. A global object is for something like the player that continues through each layout and retains its stats.

    yes the instance state will not be preserved

    it resets after change layout

  • > Depends what that object is used for, at the moment it doesn't do anything? A global layer is for something like a HUD that transitions between layouts and doesn't move, for this you don't need global objects but just put them on the layer. A global object is for something like the player that continues through each layout and retains its stats.

    yes the instance state will not be preserved

    it resets after change layout

    Just leave it as the default and it will reset. Or create it on start of layout.

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