How to detect virtual joystick release?

Hi,

I’m trying to make a mobile game and started to use the touch interface and notice that I can’t get joystick events like press, started, release, end touch for example.

It’s a top down shooter and I want make the left joystick move the player and the right joystick is the direction to shoot, and when release the right joystick then the player shoots.

Any Ideas?
(Sorry for my english)

HELP!

The built in touch joysticks interface never did much for me.
I built my own, and there’s a really nice one on the Unreal Marketplace too.

This is my code so far (it’s a work in progress)

Sorry it’s not a tutorial. Just pasted from my own project.

The idea is that you can place a (non-focusable) button with an image on it,or just an image, and this code looks at where it starts in your layout, and when you start touching the screen it checks if that touch is inside the joystick area around the button (radius), if it is, it will move the image around to follow your touch, out to the extent of the radius or otherboundaries you set.

While it’s still touched, it compares its current location against the boundaries to see how much percentage it is pushed over in one direction horizontally or vertically, and passes that on to the input yaw and forward/backward movement of the playercontroller class I’m using.

My playercontroller has some extra functions I added to help it decide what to do with the inputs, like HandleFireEvent and ThrottleAxis, but you don’t have to use those - you can just directly pass it into whatever your own fire and movement events/functions are.
You’ll need to add a few variables along with the joystick image on your UMG widget’s canvas.

You’ll have to adapt and replace things to make this work but I hope it generally makes sense.

If you can get my code to work, the next step I imagine would be to bind a custom event to the playercontroller’s On Touch Input End event: You might want to try that out first before setting all the rest of my code, to see if it will actually work to detect our touch joystick release.

What did you used? Do you have some tutorial?