Use touch input to move mouse?

Since you guys helped me so much with my scene here: https://playcanvas.com/editor/scene/494795 I would like to add touch input. I was pleasantly surprised to see that it runs on my iPhone.

But how do I add touch input for the first person shooter controls? This does not seem like an easy task because how would you map W,A,S,D and the head movement? Any solution?

You have a few options for FPS like controls on a mobile device with the most common being twin joystick controls. One mapping to moving forward, back, and strafing left/right. The other for camera look.

This article covers twin stick controls on mobile pretty nicely: http://www.gamasutra.com/view/feature/6323/a_guide_to_ios_twin_stick_shooter_.php

In terms of implementation, I was planning to creating a tutorial once our first version of UI system is ready to be made public. We have some tutorials covering touch input in general to get you started in the meantime: http://developer.playcanvas.com/en/tutorials/?tags=touch

Ultimately, implementing good dual joystick controls on mobile is hard to do so this will take some time.

1 Like

I tried adding dual virtual sticks to my ‘Doom 3: Gangnam Style’ project a long time ago. I wouldn’t say it’s a nice, clean implementation, but hey, you might find it interesting to look at for inspiration.

1 Like

Thank you will! I will look into your code.

=)