Global object destroy condition

Not favoritedFavorited Favorited 0 favourites
  • 3 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.
  • My global object gets destroyed a bit after layout change, before the 'on start of layout' trigger. Found that out by browser log. I can't show the project nor give an MRP (can't reproduce it). I tested by creating another global object, and they both get destroyed at the same time.

    I would like to ask for insight on what might be happening behind the scenes. Are there maybe some errors/mishaps that can lead to destroying global objects?

  • All I can think of is if you made them global with a global layer and the layer doesn't exist in the second layout then they would get destroyed. For more help you'd need to share the project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wow, thank you for that, lionz!

    I followed your lead and the culprit DID end up having to do with layers, although not a global one; I added a 'remove layer' event and when I disabled it, the global object stopped getting destroyed.

    Appreciate your help ^^

    For those curious, this is what I think happened:

    Throughout layouts, global objects spawn on the same layer name.

    If not found, it will spawn on the same layer index.

    If not found again, it will spawn on the highest layer index.

    That resulted in my global object getting destroyed along with my 'remove layer' event.

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