0 Favourites

How do I delete all objects on a specific layer

  • Hello everyone,

    I have a problem with my level selection.

    I have a game with 3 levels, separated in 3 layouts.

    And each level has 3 difficulties.

    I built the difficulties on different layers in the layouts. (EasyLayer, MediumLayer, HardLayer)

    What I want to do now when starting a Layout:

    • Check which difficulty was selected.
    • Set the chosen "DifficultyLayer" visible.
    • Delete all objects on the other layers, because the colliders affect the player, even if the layer is set to invisible.

    Thanks for a new perspective... _@

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Probably not the best way to do it, honestly. You'd be better off creating the additional objects (at the start of the layout) based on the difficulty, that way you can have everything on one layer.

    The only solution I can think of to the way you did it would be to use "Pick All" on every instance of that object, test if it is on a certain layer number/name, and then destroy it if it is.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic Locked topic
204 2,616,216
Kyatric's avatar
Kyatric Construct Team Support
Unread hot topic
99 10,154
karshinkoff's avatar
karshinkoff
Unread hot topic
167 14,515
DMT2005's avatar
DMT2005