There seems to be a dead space for clicking on objects in my game...Help?

0 favourites
  • 5 posts
From the Asset Store
Spaces Ambience contains 102 Sounds: 53 track and 49 sounds
  • Hello,

    I am very new to this and have never posted on here. I've been working on a game for many hours and have a curious problem. I have two objects (in roughly the same part of the screen) on two different layouts that are only clickable on part of the object. One is a sprite and the other is text. I verified that the collision object matches the sprite, and I changed the "click on object" event of the text to a combination of "mouse over" and "any click," but the problem persists in both cases.

    Anybody have any similar problems / solutions / ideas ?

    My game is probably unreadable to anyone else because it is unnecessarily complicated, and there are many variables and objects that I'm just not using anymore. I also don't know how to post the file so people can read it. If someone willing to help wants to look, I will figure out how to post it.

  • jerjamm2

    there is always a logical explanation - although it can sometimes be very difficult to find! a lot of times a fresh pair of eyes can spot the issue (usually because we have made the same mistake).

    so, it could be an issue with the events, or maybe the collision mask is ok on one frame, but not on another, or one animation works but another doesn't. It also quite often comes down to not having the correct instance "picked".

    it might help to eliminate obsolete code, and then figure out how to upload to dropbox...

  • Thanks for the helpful, quick and kind reply. I double checked some of the suggestions, unfortunately to no avail. I checked the collision masks of all of the frames, and I think I only have the one instance of each of these objects - so I don't think that is it, but maybe (I don't know being as new as I am).

    I made a shareable link of the file on dropbox. Hopefully that works. If not, is there a post about posting files?

    dropbox.com/s/6v90znfpzw2mjmz/FantasyBooker.c3p

    It seemed like cleaning this all up might not help all that much because there are so many events. Maybe someone can look at the particular layouts/objects/events and see what the problem is without needing to parse through everything? The objects that you can't click completely on are:

    Layout - BookMatchPage

    EventSheet - BookMatchEvents

    Object - RosterImage2

    Events - 4, 61-67

    Problem - Clicks on part of the image don't seem to register (roughly 750 x 250)

    Layout - BookPromoPage

    EventSheet - BookPromoEvents

    Object - CutOnWrestler

    Events - 1, 73-75

    Problem - Clicks on part of the textbox don't seem to work (roughly where "select" ends)

    I suspect that it has to do with the objects themselves, as I have moved other objects into the area of the screen that is unclickable on these and they work.

    Sorry if this is too much of a mess to work through. Thanks for any other advice/suggestions!

  • jerjamm2

    ok, I have barely started looking, but I can see that the area where you can't click on the "BookMatchPage" is exactly where the "Select" button is on the window that pops up. So, what is happening is that the select button believes that you are clicking it at the same time you are trying to open the window, so it closes it again before you even see it.

    buttons can be clicked on even if they are invisible... but in this case, it is moving the sprite into position (in event 4), and then when it executes event 6, the condition is true so it makes the SelectWrestlerPopup invisible again.

    move event 6 up above event 4, or put a "Wait 0 Seconds" action before you call the popup on event 4.

    (it is the same problem on the other page)

    EDIT: the "Wait 0 Seconds" action tells Construct to execute the actions after the wait at the end of the current tick. Doing this will have event 6 checked before the popup gets moved onto the screen by the delayed event 4.

    EDIT2: I can't make changes to your file since it exceeds the free limits (I use C2). But I am guessing you will have the reverse problem if you move event 6 up above event 4. The Wait 0 Seconds should work, but be aware that when you click the Select button, it will also register the click on the RosterImage2 (although that is immediately reversed by event 6).

    in this case it shouldn't cause trouble, but in other cases it would if clicking on a button made changes you didn't intend to happen... so, you need to think about making buttons active and inactive. There are numerous ways to do that: put the code that gets executed when a button is clicked in a group and make the group active or inactive as needed, or give the buttons an instance variable and check that when they are clicked, or put all buttons in a family, and when there are overlapping buttons use Pick Top to make sure only the button on top gets processed... etc.

    EDIT3: ok, looked a little closer at your code, and I see you effectively do disable the other buttons by checking the popup background image y position...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • YES! THANK YOU! GREAT WORK! Waiting 0 seconds worked like a charm!

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