Global object on a layer not in layout?

0 favourites
  • 5 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.
  • hello;

    Suppose I go to layout ezRace and create a global sprite called sportsCar on layer mudLayer. Then I go to layout hardRace which does not have a mudLayer it has gravelLayer. Is sportsCar still around somewhere since its UID wasn't deleted when I left ezRace? Does it just appear on gravelLayer because it can't find a layer called mudLayer? If I go back to ezRace will it know to go back to mudLayer?

    thanks for your time



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi winkr7 , i am dealing with a similar issue in my project, it seems like globar layer objects are being created on other layers of layouts not even containing a global layer.

    Wondering if it is a bug!!!

    edit: it also seems that its not even showing global layer objects on other layers but even duplicating it every time i go to another layout, i ran debug and found 6 of the same global layer object that was originally supposed to be just 1!


    I was not asking about global layers, which are distinct from global objects. A global object is supposed to survive the end of the layout, I am just wondering how it decides which layer it is going to survive on.

    So the first time you visit a layout with a global object on it, it gets activated and sort of like stepping on gum it is stuck to your shoe from then on until it is destroyed. Other objects stay in their layout so they never have to change to foreign layers.



  • Sorry i thought it was global layers we were talking about, in my case was using global objects on global layers and i think that was causing the replication,

    but i am also dealing with a case similar to yours and yes the program is creating global object on every layout (on a random layer when similar layer does not exists), in my experience it is creating on random layer because in my game the layout with global object has it on layer number 8 but when i change layout it creates the global object on layer number 1 (while the layout has three layers(0,1,2)) it should technically choose the top layer as default but it didn't so i think its random, i could be wrong though!

  • Logically it should act exactly like you specified, however not sure if thats how they are working. So i checked this two manual entries and they seem to say something along those lines that you are thinking of...

    Global instances

    Persist behavior

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