How do I lock layers from clicking?

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

    I'm very new to Construct 2, and I'm working on making a game where I need objects to appear on and off of the screen. Right now, I have them each on a separate layer set to invisible, and when a certain object is clicked they become visible (and vice-versa). However, I've noticed that being on an invisible layer does not prevent an object from being interacted with, and this would cause issues with my game. Is there any way to lock (and unlock) a layer from being clicked on by the player?

    Or, is there a better way to do this? While writing this post, I had the idea of moving the objects off the screen and having them change position to onscreen when a certain object is clicked. This would be rather tedious though, since I have things like a Calculator which consists of 19 different objects that would have to be moved.

    Does anyone have any suggestions?

    Thanks

  • You can add multiple conditions to an event.

    And each object has a "Is visible" condition.

    In your event where you handle when the user click on them, add a condition "Object is visible".

    This way, when the object is invisible the event won't execute.

  • Fantastic, this works perfectly. Thank you for the quick response.

  • Just adding additional info:

    Blackhornet did a great example here

    Another method is to place events into groups and deactivate/activate them.

    However, using the condition is visible is very neat and tidy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • DUTOIT, I just tried this out, but when I tried to add the action "Set group active" and type in the group's name, the event group didn't appear in the list below.

  • It doesn't appear in list Its like a function you have to type it as you originally named it.

    Create Group and give it a name Group One.

    Now system > set group "Group One" Activated.

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