How do I not click through a sprite?

0 favourites
  • 2 posts
From the Asset Store
Click! Click! 136 click sounds for your video games or media projects
  • Hey there!

    I've been working on an idle click game that works with a lot of "menus" I have sprites on a main layer that pop open menus in a different layer. Those menus have sprites that have their own actions. Outside the menu I have transparent sprites that trigger the menu to close. My issue is that, when on a menu layer, if you click a sprite with an action, only that action triggers, but if you click on the menu itself (in between the sprite "buttons") or even on the text, and it's overlapping a sprite on the main layer, the sprite on the main layer will trigger it's action.

    So, basically, I'm accidentally clicking on a sprite on the layer under the active layer. I tried laying a sprite the same size as the menu underneath the menu that triggers the same layer to become visible, but the click is still registering to the sprite on the lower layer.

    Is there any way I can stop this from happening? Since the menu that's being clicked through is a sprite, itself, that is only used for aesthetic purposes, can I give it a property (behavior, action, etc.) that will prevent anything that it's overlapping to be safe from accidentally being clicked?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could use the sprite is on layer condition or even better create groups for the events and deactivate these groups when not needed..

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