Can you kill a layout?

This forum is currently in read-only mode.
  • Hello, thanks for reading!

    This is one that's been bugging me for months; when you call GoToLayout, isn't it supposed to kill/destroy/reinitialize the layout you just quitted? Like otherwise if you want stuff to be changed forever in your game you'd need to store that info in global variables, no? Otherwise switching layout means reseting layout?

    When I quit my game to the main menu, then with the world map GoTo the same layout I just quitted, it seems chaos just occured while I was gone; the character seemed to fall throught the enviro while I was gone and always spawns a little lower in the level everytime I come back, particles never seem to have stopped growing and grew huge, it lags a lot like as if the whole game was running twice, my character visual is invisible and nothing seems to make it appear, I only see his collision box, it's just madness. I do not use global variables.

    So I was wondering am I missing a step or a notion here concerning level structure? I'm aiming at a world structure similar to Mario World.

    Thank you so much!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it possible to recreate this bug in a barebones .cap. I'm afraid, ppl can't help you really much without seeing a .cap.

  • Have you set any of the objects with the "Global" property? If so then they are not destroyed and re-created automatically when switching layouts.

  • (frontpalm) well that must be it...!

    I pictured the fact of flagging objects global as a way to have the game objects in one basic layout then using references for building each level layouts. Old habits...

    so then I should make a copy of each objects in each layouts and not flag them global, unless I want something like a blacksmith forging a sword for me while I'm gone or something like that.

    Thank you so much, I'm going to try that right away.

  • Yeah, I realized that was breaking a game I was working on as well. But now that I know how Global works, it's pretty awesome =D

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