- Home /
How to Fire a projectile using the right joystick(mobile assets) ?
hello, I'm in doubt .. I created a dual joystick that comes in the mobile assets and would like to how to put it in my code in the input for example "Input.GetKey (the name of my joystick)? I'm doing for my right thumb throwing a projectile then such
var fireTouchPad: Joystick;
function Update () {
if (Input.GetButtonDown ("Fire1") && (time.time> lastShot fireFreq +)) {
Fire (); "
I wonder if I have to put my right joystick instead of "Input.GetButtonDown"?
thanks for the help
Answer by mdinizzz · Mar 28, 2012 at 04:20 AM
i found solution
put this
var fireTouchPad : Joystick;
function Update () { if (fireTouchPad.IsFingerDown() && (Time.time > lastShot + fireFreq) ) { Fire();
Your answer
![](https://koobas.hobune.stream/wayback/20220613065423im_/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
What is the command to use a joystick in the Input Manager? 1 Answer
How to add the Joystick for iOS devises in my scene? 0 Answers
Setting Up Joystick With 3rd Person Controller 0 Answers
Mobile Virtual Joysticks / Keyboard Script Conversion 0 Answers