How to make virtual joystick trigger thumbstick button press/release events?

I was wondering if there’s any way to customize the default virtual joystick to trigger thumbstick button events (press/release).

I’ve already configured my inputs correctly and it works fine with a controller (XBOX 360 controller), but now I need to make it work with the virtual joystick (since I’m trying to make a mobile game).

If it’s not possible, are there any resources on how to make my own virtual joystick? Preferably with UMG / Blueprints, since I’m not particularly good with C++…

Thanks in advance for your help! :slight_smile:

The only way to fake input currently is to do it in C++, you’d need to look at the virtual joystick to see what it does. What is your plan to simulate the press/release events of the stick on a touchscreen though?

I’m trying to use the stick as a button, to avoid having an extra button for a separate - but related - action:

If the user press/tap the stick, without moving it, I’ll do something (attack, block, use, etc.), if he moves it, I’ll do something else (move, aim, look, etc.).

And, just to clarify, I don’t need to trigger exactly the same input event. I could do with a custom event or something like it.

Why do you need to set it up as an input? I get that it makes it easier if you are referencing multiple blueprints etc but you could always just make them a blueprint with a touch event on there, check the time it is between touch -> release and if its short enough cast off an event

I don’t need it to be an input, like I said above.

But my problem with simply detecting the touch event is: how can I be sure the touch was in the stick? Since the virtual joysticks can be recentered, that becomes a little difficult.
If the joystick itself raised the event, it would be much simpler. It could also be used to add visual feedback (change the stick appearance if it’s pressed).

I figure it would be useful for other people and situations too, who knows?

But I think I’ll try my luck later with the C++ code.

Couldn’t you just match the location of your hit box with the joystick, or you want it to be right where the centre of the joystick is anyway so just place it there with a decent size to it. You should easily be able to change the colour of the joystick through this as well

I may do something like that if I can’t figure out how to do it in C++.


Hello! Is anyone has solved this problem? Help me to understand, how can i do it?

I havent been able to find a good answer to this either so i’m giving it the raise dead spell…forum necromancy…all may hate me.

Best i’ve come up with is disabling the auto recenter so that the joysticks stay in place and adding a branch to test if the input is short enough to be considered a tap.

Other problem i’m having is setting a new button that’s just a tap button. Everything suggest that i should be possible but I havent found an answer yet. I can get it where the “joystick” moves really easy and any movement triggers what I want so it only moves 2-3 pixels but it’s not exactly what i was looking for.