Please help me create dual joystick :((

Please help me create dual joystick, i can create 1 joystick but when i click to it, funtion gun active because t create to event getmousebutton, beside my joystick can move but it can’t rotate around, please help me, thank you vary much :slight_smile:

Which ever way you made the first stick, make a second one with the same method, and give the target axis different names. :slight_smile: (I assume you’re using new UI and CrossPlatformInput package though…)

Don’t use mouse click for joystick.
Use Input.GetTouch(i) to get your every touch and Touch.position to watch it’s movement deltas

Basically when you get touch (check for that in Update cycle using Input.touchCount) you start a cycle and cycle through all touches you got and for each one of them get it’s position at touch start and check if it’s inside your stick circle. If it is then use it’s position to change stick’s position.
Just don’t forget to lock it for other input processes in script by using some kind of locked finger id collection adding a finger which position you use there every time and remove it when your Touch ends (check by using Touch.phase)

PS: Or you can simply use OnDrag. If my memory serves me right that’s what Unity Example Joystick uses.

Is this coming from unity 4.6? If the OP’s using Unity 5, I suggest using crossplatforminput, of which is almost foolproof for making… er… cross platform controls. :smile: