How do I make objects non clickable?

  • Hi

    I have 2 layers with multiple objects. Some objects are on the same coordinates but different layers. My problem is both objects are triggered with On clicked, eventhough the second object is on bottom layer which is not visible.

    Is there a way to make sure only the visible object is "clickable"?

    Thank you

  • I do this. It checks if the layer the button is on is visible.

  • I'm afraid that doesn't seem to work for me... Here's my aprox. event:

    On object A clicked -> Object B do something.

    Both object A and B are on layer 0 and on layer 1 and even if I add the is layer visible condition, both object Bs do something - the one on layer 0 and the one on layer 1.

    Maybe I should change topic title to layers instead of objects but I don't know hot to do that.

  • Try to do the following:

    -> On object clicked

    Pick top object ( on the object's conditions) : Do stuff

  • This isn't working either. there are multiple instances of both objects on both layers and now only one (the top one) is doing something - instead of all instances of the B object that are on layer 1 :(

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure if I get the intended mechanics then... mind sharing a sample project?

  • This is just a small part of a larger project which I'm not allowed to share.

    So instead of looking for a way to "disable" a layer that isn't visible I added events to destroy all objects that are not on the active (visible) layer. Probably not the best solution but it seems to do the trick :)

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