Problem with mouseclick behavior

In order to navigate the sidebar in my game, you have to click on arrow buttons. The problem is, that after two clicks, both mouseclick behaviors stop responding. Does anyone else experience this or is it just me?

I haven’t looked at the code but I’m guessing it’s because you have 2 mouse click behaviors. Make sure the messages are set to “send to myself”

If you have to mouse behaviors with Down things get messed up, so when you need a down just use a mailbox with “down”.

@grazer
Whenever I replace the mouseclick behaviors, it will work fine. Then, I’ll open the game in a new tab and it will be broken again. I’ve tried adding distance between the two buttons, but that doesn’t work either. It’s not that the buttons don’t work, it’s that they only work sometimes.

Also, I’m not using messages or the ‘down’ setting.

1 Like

Looking at the code rn, I’ll see what I can do in a sec

I have absolutely no idea why this works, but add a second mouse not connected to anything. That fixed it for me. Also nice game, is it for the jam?

1 Like

Yes. I do these for the experience they provide. That tutorial was my very first (competent) tutorial.

1 Like

Did adding another mouse behavior fix it?

1 Like

Yes, it did. As soon as Grazer gets the bug fixed, I’ll give you the ‘Solution’.
Thanks so much for the help!

1 Like

@grazer
This problem is still consistent. I was wondering if you would fix this before the game jam is over, because it’s a large, game-breaking bug that I can’t fix myself.

Hey @DarkStar_Studios - I haven’t looked at this issue yet, but I’ll do it now. Can explain to me how to reproduce the problem, and where are the mouse click triggers that are not activating?

In the main game, the two arrow buttons that navigate the sidebar will stop taking inputs at page 4. This should happen automatically.

Hey @DarkStar_Studios - here’s what’s happening:

When you get to page 4, the Axe/Hammer weapon (New Type 114) moves into the same spot as the arrow buttons, and now the mouse click cannot tell which object is supposed to be getting the clicks (the hammer/axe thing is getting them instead of the arrow).

It would be worth adding some way to disambiguate mouse clicks somehow so that you can select how overlapping objects should share clicks (or not), but I won’t be able to do that tonight.

In the meantime, you can solve this a few different ways:

  1. Make the icons in a single vertical column instead of a grid, and move them up/down instead of left/right (probably the simplest)

  2. Spawn & destroy the column of icons for each page when you change pages

  3. Move the arrows somewhere else, so they don’t overlap (maybe the top or something?)

  4. Use a single column of icons, and just change animation frames instead of moving them around

Maybe other ways too? Those are just the first ideas that came to mind. Let me know if any of that doesn’t make sense

1 Like

I tried option 1, and that seemed to fix it. Thanks so much for the help!

1 Like