- Home /
The question is answered, right answer was accepted
How to use Android Dual Joysticks?
Hi, I'm building a game for android, and I encountered an issue. how do I control the input for the controller? I thought of using the values of the positions in each of the triggers, but since I'm working on C# and they are written in js, I don't know how can i access them.
Answer by equalsequals · Jul 01, 2013 at 04:45 PM
I guess this is more of a question of Unityscript to C# communication vs. the usage of the Android dual joysticks. I'll take a stab.
You have a couple options:
The first is obviously to port your .js scripts to C#, and all will be well, but there you obviously run the risk of inadvertantly breaking something.
The other option is that you can place any .js files in a folder called "Plugins" they will compile before the C# classes you have written, making all of the variables and references available to you.
Note that they may or may not show up in code-hinting in something like MonoDevelop, but your C# classes will still compile correctly even though you are referencing a .js as if it were also C#. Obviously the compilation success is all that really matters.
Hope that helps.
==
Thank you, that made me search for a C# version of Joystick.js I found it here: http://forum.unity3d.com/threads/29432-Converted-Penelope-s-Javascript-Joysticks-to-C-(c-sharp)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Lower player's health from separate script. 2 Answers
Spawning portal 1 Answer
Temporarily disable gamepad button 1 Answer