Is it possible to make a joystick that works with buttons?

I’m making a first person shooter but the joystick always stops working when I press a button.
I’ve seen other projects do it well but they are all old and the code won’t work even when I copy it directly. Is it possible now or did an update break joysticks at some point?

17 Likes

hey, unfortunately, you cannot make a joystick + button. Hopscotch doesn’t support multitouch, so when you press “shoot”, the joystick points at your new last touch X and Y, which is the button.

Btw, welcome to the forum :)

9 Likes

The joystick will freeze temporarily when you press the the button, but will move again when the button is released, and it works perfectly otherwise:

How this works:

  • All buttons have a tap rule as normal
  • the joystick has the same when pressed, except that it checks the last touch point and makes sure that it’s close enough to the center of the joystick. If not, it won’t move.

This way, it keeps checking when the button is pressed, but it won’t change position when you’re pressing the button.

Hope that helps!

12 Likes

They should add multitouch.

Welcome to the forum!!

9 Likes

Welcome to the forum @PigeonBoi.

I agree with Dragongirl1264. I know it’s possible. I’ve seen a PixiJS demo on it.

7 Likes

Sadly you cant because Hopscotch doesnt support multitouch.

7 Likes

It’s not that it doesn’t support it, it’s just there’s currently no way to get unique touch positions from multiple fingers.

Multitouch incompatibility would mean you can only tap one object at a time. And we both know you can tap multiple objects at once.

5 Likes

well yes you can touch multiple things at once, but thats not what i meant.

4 Likes

Thanks! I’ve already made a joystick that works well enough returns to the centre when something else is pressed.

6 Likes

I believe it existed at one point but no longer works. Maybe it was never supposed to work.

5 Likes

The point is, the joystick will work again when you release the button afterwards. This means you can still use the joystick without having to let go of the finger on the joystick.

But if you truly need to move both at the same time, then it’s not possible.

5 Likes

Well, not natively possible, at least…

5 Likes

Welcome to the forum!

3 Likes

They should. For example, if you wanted to jump and move right for a game, you’d have to jump, then move right, or move right, and then jump.

3 Likes

bump
hope you figured it out
people rlly need to view this
lots of people have similar problems
@leaders should probably archive this
just check with the creator of this topic first

1 Like

Hey @PigeonBoi - did you manage to solve this?

1 Like