Problems with tap/click on sprites

0 favourites
  • 3 posts
From the Asset Store
High quality sound effect pack, in the following categories: Simple, negative, pozitive
  • I'm new to Construct, so please excuse my ignorance. Unfortunately I keep encountering various issues, then I solve it and encounter more.

    I have a button that mutes the sound and music in a game I'm building and I have a quit button that is next to it. The buttons are anchored at the top of the screen. They are not directly next to each other and they do not overlap.

    I have a touch "object event on the sound icon and a touch object event on the quit button. When I debug or preview the game and click on the sound button it thinks that I clicked on quit intermittently.

    The sound button toggles a boolean variable that controls the sound and the quit button resets all the global variables and returns to the start screen.

    No matter what I try, it continues to do this. What am I doing wrong? I don't understand it and it's driving me crazy. I'm already way over due in delivering this and I'm encountering problems like this that make no sense. Any help is greatly appreciated.

    Here's a link to the current file..

    https://www.dropbox.com/s/d14t42zzn48s4j9/SpaceChallenge.c3p?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you familiar with global layers? The issue is that you have several quit buttons on screen and some are invisible or hidden below. The cause is because you are using global layers incorrectly.

    When you use a global layer you can leave the UI in one layout and it follows through to the other layouts, if you create the objects in every layout then it will duplicate them. The idea of it being global is so you can easily make the HUD once in the first layout and it follows through. You do not need to make a volume / quit button in each layout. If you run in debug mode you can see the several instances of buttons that exist.

    Also the reason they are hidden is because you have different hierarchy and number of layers per layout. If you are using global layers you should be using the same number of layers so that the global one has the same ID/number and name. i.e. Mobile UI layer could be 5 in each layout and should alter its position

    So 2 things to fix :

    - remove any objects that appear in a global HUD layer from all the layouts except the first one they appear

    - make sure you use the same number of layers in each layout and they are named the same and in the same order

  • You've got various global layers that are interfering with other layers/layouts. You have be careful with this.

    If you go to the Game layout and the Mobile UI layer and turn off Global, the sound button now works on the Captain Intro layout.

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