Object is not invisible when on invisible layer?

0 favourites
  • 6 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Is this correct? If I make a layer invisible, and then do a count of visible objects which are on that layer, it still reports that all of the objects are visible, even though they're not. Does the fact that they're on an invisible layer not set them as invisible?

  • Making the layer invisible used to make the 'Is visible' object condition return false, but some users disagreed and said they needed separate control. So the 'Is visible' condition only returns the object's own visibility flag, which is still visible even if on an invisible layer, and even if offscreen. If you also want to test the layer's visibility, just add a 'Is layer visible' condition as well.

  • I can see the wisdom of that approach, I can see times when the extra control would be useful, and you can never have too much control :)

    On the other hand, a simple command to combine everything might be useful if it was possible, something like a 'Is showing' which combines everything to determine if the object is actually showing at that time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm having a really strange problem with this which I can't resolve.

    I have 3 layers, each with a tile on it, which I want to be clickable with the mouse. They're all in the same place but I only want the one on the currently visible layer to be clickable. The tiles are in a family but I don't think that matters here.

    So the solution would seem to be....

    Mouse - On left button clicked on 'tiles'

    System - tiles.Layername is visible

    I would have thought this would filter so that only the tile which is on the visibile layer would be picked. But it doesn't work when there are 3 tiles ontop of each other, and only one layer is visible (it picks none). If I move one of the tiles so that it's not in the same location at the others on the invisible layers, it does pick that one tile when visible and clicked).

    Just to add to that, if I remove the second condition (check if the layer is visible), it does then correctly pick all 3 tiles. So the first condition is working correctly, it does pick the 3 tiles that have been clicked, but something's wrong with the way it filters the next condition.

  • Mouse - On left button clicked on 'tiles'

    System - tiles.Layername is visible

    It's probably just checking the visibility of the first layer. Try a 'for each tiles' in between those two conditions.

  • Yep, that worked, thanks. Still finding it a bit confusing when I need to use a 'For each', since I'd filtered the objects correctly and thought the subsequent conditions applied to each of the filtered objects anyway. Still, it works.

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