[solved] Touch button working on desktop but not on touchscreen

Hi all,

I’am adding touchscreen controls for my platformer.

The joystick and the a button for jump are working, but I added a second button (b) for the character to shoot.

This one works correctly on desktop when I click on it, but it does not works on a smartphone.

the character has the PlatformerMultitouchMapper and the platformer behavior with default controls.

Buttons have multitouch button behaviors

But the second is not in the mapping of the character, maybe this what is missing ?

Thanks your help

:wave: Hi and welcome here :slight_smile:
If you have an event that says “if device is mobile, disable cursor”, the cursor position events won’t work.

What do you mean?

Thank you Gruk for answering.

“if device is mobile, disable cursor” > I have no such event in my project.

I meant maybe there is just a mapping missing, as I drawn below in red ?

I find it strange that in the controller mapping behavior there is only one button.

I see.
It’s not in the platformer mapping, because the platformer behavior doesn’t have a shooting feature, but it does have a jump feature.
You should be using these conditions instead of the regular cursor/touch condition:
image

Thank you Gruk I will try and keep you posted.

It does work !

The solution was in front of me and I couldn’t see it.

Thank you again this was very helpful !

1 Like