# How to detect virtual joystick release?

**URL:** <https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926>\
**Category:** Blueprint\
**Tags:** virtual-joystick, touch-interface, unreal-engine, touch-event, question, Blueprint\
**Created:** [October 3, 2018, 2:44am UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926 "2018-10-03T02:44:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZenomyErif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZenomyErif](https://forums.unrealengine.com/u/ZenomyErif)\
**Post date:** [October 3, 2018, 2:44am UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926/1 "2018-10-03T02:44:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [October 3, 2018, 9:13pm UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926/2 "2018-10-03T21:13:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ZenomyErif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZenomyErif](https://forums.unrealengine.com/u/ZenomyErif)\
**Post date:** [October 3, 2018, 10:59pm UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926/3 "2018-10-03T22:59:17Z")

</div>

What did you used? Do you have some tutorial?

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [October 3, 2018, 11:35pm UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926/4 "2018-10-03T23:35:22Z")

</div>

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

> **[Make your own touch controls posted by anonymous | blueprintUE | PasteBin For...](https://blueprintue.com/blueprint/semkwmj8/)**
>
> No description provided

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [October 3, 2018, 11:40pm UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926/5 "2018-10-03T23:40:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [October 3, 2018, 11:45pm UTC](https://forums.unrealengine.com/t/how-to-detect-virtual-joystick-release/434926/6 "2018-10-03T23:45:13Z")

</div>

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.
