"on destroyed" Events firing when Layout changes

0 favourites
  • 5 posts
From the Asset Store
Plugin Transition Layout C3. Layout opening and closing animation for C3. Quickly set up transitions between lay
  • Problem Description

    "on destroyed" Events firing when Layout changes

    Attach a Capx

    comes later

    Description of Capx

    ____ Concise description of what this CapX does ____

    Steps to Reproduce Bug

    • Step 1: have Sprites with an "on destroyed" event like on destroyed->create particles..
    • Step 2: change the layout to a different one, see particles created on the new layout
    • Step 3 etc.

    Observed Result

    when i change the layout (in my case from Game to Menu) particles are created where on the former layout the sprites with the on destroyed event where

    Expected Result

    nothing beeing created

    Affected Browsers

      every Browser and Previewmode

    Operating System and Service Pack

    Windows7, Android 4+

    Construct 2 Version ID

    178

  • Closing, no .capx attached and the described behavior is by design. Changing a layout destroys all non-global objects, and their 'On destroy' triggers fire accordingly.

  • do you have a solution for that not to happen? destroying non global objects is fine but i dont think anyone want the on destroyed events to happen at this moment, why did you design it that way? is there a reason i dont get? im imaging a lot of problems by this behaviour and more complicated "code"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set a flag when changing layouts and ignore the triggers when they fire when that flag is set.

    It happens because it is a logical consequence of triggering "on destroyed" when the object is destroyed, and the fact that changing layout destroys all non-global objects.

  • ok thank you, i will try that!

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