start of layout bug???

This forum is currently in read-only mode.
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • ... layout.cap

    I recreated this after finding some weirdness in my game.

    I destroy an object at start of layout, but it doesnt get destroyed until its registered a collision.

    While this is a simple demo of what I found, It's causing me some issues in my game and am wondering if that's how it's meant to be or if its a bug whereby the start of layout isn't doing as it should.

  • The

    Start of Layout -> Destroy an Object[/code:3225ty31]
    Works for me without collision detection.
  • On my machine it does detect overlapping once.

    Looks like for the time being you'll have to use Private Variable (for example variable named "Destroyed"). When destroying object you should set this PV to "1" and call Sprite->Destroy as well. Since object is deleted from collection at the end of loop, this PV would control "if this object should be included in coll detection".


    This "delayed destroying" also was in Fast Loop Object in TGF.

  • On my machine it does detect overlapping once.

    Oooooooh its about Detecting overlapping (facepalm), well it detects on my machine too.

    BUT check it out:

    1.) Set "Start of layout" event as last

    2.) Set "Always event" as second

    3.) Set "Overlaps" event as first

    4.) ???????????

    5.) Fixed

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This .cap may not act like you want but it is not a bug. The 'Destroy' action simply sets a flag and continues to work exactly like normal. At the end of the event list, objects marked 'destroyed' are then really destroyed. It has to work like this unfortunately - the runtime needs to know that objects exist until one point. It also needs to be like this to give plugins a chance to remove references to the object that is being destroyed - otherwise these plugins would crash and there would be no way to fix it!

  • if you tick the destroy on start up attribute instead does it still happen?

  • will have to try it.

    thanks for the suggestion

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