Search Unity

Can not find any working example on how to implement Joystick with Android and C#

Discussion in '2D' started by cbergau, Aug 12, 2014.

  1. cbergau

    cbergau

    Joined:
    Aug 12, 2014
    Posts:
    1
    I've been looking for 3 days now, googled alot, but can't seem to find an answer.
    I want to use a Single Joystick with Android and C#. Now here is what i did:
    1. Import the Assets for mobile, and renamed folder to "Standard Assets" (from Standard Assets (Mobile)) (was something on google)
    2. Click on "Prefabs" and add Single Joystick to the scene.
    Now wait a minute, there is a JS file. I mean, why JS? Im doing C#. This can not work.... so googled again a little, there was a C# conversion which totally did not work, the joystick did not even move on touch events. So probably the C# thing is legacy not working code.

    Ok, so i googled again and found out that i can use Input.GetAxis("Joy0X");
    Tried that but this always returns 0, no matter what i do.

    I could not find any working example. Can you help me out?

    EDIT: Input.GetAxis("Horizontal") also returns 0 all the time.
     
  2. Punchbag

    Punchbag

    Joined:
    Oct 30, 2012
    Posts:
    48