My inputs are not working now?

if (OuyaExampleCommon.GetButton(OuyaSDK.KeyEnum.BUTTON_A, OuyaSDK.OuyaPlayer.player1) && load == true)
        {
            audio.Play();
                Application.LoadLevel("MPMenu");
        }


All my controls are set up like this. It use to work. For some reason its not working and my xbox controller doesn't work in the editor either. But works on another project that still has UpdateJoysticks()


Any ideas thank you.

Comments

  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    I would suggest that your load field is not true. The best thing to do is to add labels to figure out and diagnose the issue.

    Try adding a function to your GameObject script.

    function OnGUI()
    {
       var buttonA : Boolean = OuyaExampleCommon.GetButton(OuyaSDK.KeyEnum.BUTTON_A, OuyaSDK.OuyaPlayer.player1);
       GUILayout.Label("Button A: " + buttonA);
       GUILayout.Label("Load=" + load);
    }

    When you use logging and labels it makes it faster to determine logic errors.
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • GodatplayGodatplay Posts: 2Member
    Boundless, did you end up getting this figured out? I've had the same issue and debugging it didn't seem to lead to a full solution. However, for me, my Xbox controller works in the editor, but both that and the Ouya controller don't work on the device.

    So far what I noticed is that I had my input script added to OuyaGameObject, and on that script I had an object referenced that I was passing input values to. I was getting null references every frame for that object.

    I noticed in the Ouya panel during the build process I would lose the connection to OuyaGameObject. So I thought maybe the object reference would get lost too, so I decided to move my input script to its own object and reimported the OGO prefab. What do you know, no more null refs.

    However, what's even weirder is that I don't get any more console output every frame, either! And I get it fine in the editor. Super weird...
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    There should be in OuyaGameObject in your init scene for the payment system to talk from Java to C#. OuyaGameObject also calls OuyaSDK.UpdateJoysticks(); in the fixed update.

    OuyaExampleCommon.GetButton and GetAxis should be returning input that you can see in that label????


    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • GodatplayGodatplay Posts: 2Member
    edited August 2013
    USER ERROR b-(
    And a stupid one at that. I figured it out.
    Post edited by Godatplay on
Sign In or Register to comment.