- Home /
Scripting for UI Buttons/Images
Hi people. I'm making a game for mobile devices and I want to create controls that work by pressing buttons on the screen. I'm making a touch version of the arrow keys, my question is if it's possible to program the functions, like OnMouseDown but for touches. I'm trying to create such a script because I have 18 levels, and going though each one of them setting up the buttons seems a bit unpractical. Is there a way to program the button's functions in order to prefab the whole thing?
import unity Standard Assets ($$anonymous$$obile) and use the joystick. then put the script in a folder you need to name (Plugins). So you can access the script if you are using C#
you can get the position (X and Y) of the joystick. and it's just like Input.GetAxis("Axis") method.
Your answer
![](https://koobas.hobune.stream/wayback/20220613175306im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Button reaction time problem 1 Answer
c# Quit button wont quit game 1 Answer
[Unity Editor] Emulate Touch Input - Still Asking 12/10 1 Answer
Button Touch Animation 0 Answers