containers: deleting a member

This forum is currently in read-only mode.
From the Asset Store
A well commented Dynamic Heart Containers template to learn from or to use as a base for your own game!
  • In my cap I have 1 container containing 2 sprites.

    I forgot it was connected to eachother and made the following code:

    Function: On function "Function2"
    

    <Sprite2> Destroy Sprite2[/code:l66xgvgx]

    I started to preview and while Function 2 was not called yet, the 2nd member of the container (Sprite 1) showed unexpected behaviour: being visible, while it shouldn't, or stopped moving while it should move.

    (I changed "destroy Sprite2" into making it invisible. And everything is working as expected.)

    Should this be considered as a bug, or as a request to implement a question when trying to destroy/delete members of a container?

    By the way, I know that when clicking on a sprite, in Layout Editor, all members of the container turn yellow. It could be that the developers might think: that's enough for now, concerning container-related help.

  • i can see where that confused u. maybe a quick little pop up text or description saying "remember when any object of container is destroyed all will be destroyed." would be useful. the wiki says something similar but i can see how new user can easily forget.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Unless you post a simple .cap showing the problem on it's own, it's probably your own events causing problems. But remember containers are defined as always creating and destroying at the same time.

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