Strange error on returning to layout

  • I have a game where you go into a blackhole to be sent to a random layout.

    However, right now, I only have it set to go to a specified layout, for testing purposes, but this doesn't work correctly.

    Layout 1 has a bunch of objects placed on the layers.

    On Layout 1, when I go into the blackhole,I go to a Menu Layout and choose a layout. If I choose a new layout such as Layout 2, it works fine. However, if I choose Layout 1, it gives me an error.

    Upon extensive testing, I removed every object from the pre-laid layout, and once I removed every single object except the portals, only then did it stop giving me the error. I decided that perhaps "creating" the objects through the system on Start of Layout would be the way to go to avoid this error.

    However, upon testing that idea, I tested it out by going through the portal and back to Layout 1, and it seems to give me that error again, usually around every 7 to 10 cycles.

    Here is the log:

    Debug4 is the test layout, and SPACETRAVEL is the "Menu" for selecting a layout to go to.

    Change layout signalled to Debug4
    Go to layout: SPACETRAVEL
    Change layout signalled to SPACETRAVEL
    Go to layout: Debug4
    Change layout signalled to Debug4
    Go to layout: SPACETRAVEL
    Change layout signalled to SPACETRAVEL
    Go to layout: Debug4
    Change layout signalled to Debug4
    Go to layout: SPACETRAVEL
    Change layout signalled to SPACETRAVEL
    Go to layout: Debug4
    Change layout signalled to Debug4
    
    Assertion failure: Drawing instance on wrong layer
    
    Stack trace: 
    Error
        at Error (native)
        at assert2 (http://localhost:50000/preview_prelude.js:16:10)
        at Layer.drawInstanceGL (http://localhost:50000/layout.js:2152:22)
        at Layer.drawGL (http://localhost:50000/layout.js:2091:9)
        at Layout.drawGL (http://localhost:50000/layout.js:637:7)
        at Runtime.drawGL (http://localhost:50000/preview.js:2531:23)
        at Runtime.tick (http://localhost:50000/preview.js:2070:10)
        at tickFunc (http://localhost:50000/preview.js:623:47)
    [/code:30529cc7]
    
    Once I press okay on the error, the game has less FPS and some objects seem to be "stuck" and inactive.
    Any ideas?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • After lots of hours, I found a thread with hints on how to work-around this frustrating issue.

    The problem could have been easily avoided if given a "Remove object" as oppose to "Destroy object"

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