Dual Joystick/Touchpad for move & aim

Updated on May 22, 2015 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
9 on February 3, 2015

Hey everyone 🙂 I though it was time for me to learn about touch input 🙂 I want to convert an old project to mobile. I’ve been looking through a bunch of tutorials. For example THIS(the code is below the video if you want to have a look :D). The touch areas work great on their own. I set it up so the right area handles movement and left is for rotating. But using them together just messes it up. If I start moving the player down and then put my finger slightly up from the center in the aim area, my player starts moving up. Its like both my fingers affect the area I touched first. However, in the video he says he can use them both at the same time. I tried the exact same thing as in the video, right side is move left is shoot. Same result.

THIS is the kind of thing Im hoping to achieve.

I googled some on this problem and it seems I was not the only one to encounter it, however those problems were not solved.

So if any of you are experienced with touch input, what could be the problem?

  • Liked by
Reply
0 on February 3, 2015

It would be helpful if you posted your code for touch input. Without seeing your code though I’d guess that at some point you copied and pasted some line or lines of code. Check to make sure that you changed the variable names correctly as well as the coordinates you’re checking for the touch.

  • Liked by
Reply
Cancel
0 on February 3, 2015

If you look at the link to the tutorial I watched, there is code below the video. There are 2 scripts, attached to different UI images.

  • Liked by
Reply
Cancel
4 on February 4, 2015

I can’t see the code too

Master
on February 4, 2015

The code is right there below the video player…

Wise
on February 4, 2015

http://s3.postimg.org/3lie3aleb/sshot.jpg

That’s all I see, srsly!

Master
on February 4, 2015

OH sorry about the confusion 😛 the code is below the video in the First link.

I’ll just post it here 😛
http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/space-shooter-to-mobile

I‘ve also tried using the Joystick/Touch Pad-scripts from the 4.6 Sample Assets. Had the same problems once I got it set up :/

on May 21, 2015

I got the same problem lately, still looking for a solution.

Show more replies
  • Liked by
Reply
Cancel
1 on May 21, 2015

Problem solved when I did a build of my project and tested on the device. So for me the problem was the Unity Remote-app I was testing it with in Unity.

on May 22, 2015

Had tested my own project as you did, and it works! thanks for telling me.

Show more replies
  • Liked by
Reply
Cancel