An actual solution for Unity Input?

I've been hunting through all the forums, looking through all the video tutorials,
trying every solution I could manage to spot, but anytime someone has worked
it out they haven't specified how, and everyone seems to be either doing something
others aren't, or not doing something others are.

I'd be incredibly grateful if anyone has an actual working solution to be able
to get Unity keys to activate actions, similar to how it is mentioned here -
http://forums.ouya.tv/discussion/255/standard-unity-input-reference
So not setting up things in Unity's input manager but having actual
existing keys correspond to the OUYA controllers buttons.

Is someone please able to either upload a working script change they have,
or at least directly detail all code changes they have made?

Best Answer

  • AyrikAyrik Posts: 429Member
    Answer ✓
    @SwiftIllusion just remove the ODK from the project completely and everything should work fine.

    In order to get the game listed in the Games section, just add a file named "AndroidManifest.xml" into "Assets/Plugins/Android" and paste the following into it:

    Note that this will disable the ability to use In-App purchasing. Also, to support controllers other than OUYA controllers will be a lot more difficult for you.

Answers

  • nightlightnightlight Los Angeles, CAPosts: 24Member
    Just to chime in- we've been in constant contact with a dev from their team.  According to him it isn't working with his dongle but "you can use a PS3 or Xbox controller for the IDE for now..."
  • SwiftIllusionSwiftIllusion Posts: 33Member
    Thanks for your input :), regrettably though that isn't a solution for me as I need it to be actually working with the Ouya controller (I'm building it to the ouya console). I have pc controls functioning with it to play it in the IDE.
  • FelineArtsFelineArts Posts: 57Member
    edited January 2013
    im planning in releasing my game for ouya and pc, so i created a class called MyInput wich gets input from both, ouya controller and regular controllers on unity/pc, here is the code


    i still have not mapped all the buttons, i mapped the ones i needed but im sure you can upgrade this script easily, put this script in the ouyaGameObject and configure the Input manager with the keys o,u,y,a using the control mapping from the post you linked

    then you only do:

    if(MyInput.buttonO){

    }
    Post edited by FelineArts on
  • FelineArtsFelineArts Posts: 57Member
    but before this works, you have to follow the first 3 videos uploaded by tim
  • SwiftIllusionSwiftIllusion Posts: 33Member
    Thank you so very much, however at least to my understanding this again
    uses the Unity input editor which I mention I can't use.
    I'm don't have the memory required of programmers but I understand enough to
    be able to develop my games using Playmaker (visual editor).
    With that I can have events run for example when input 'spacebar', etc,
    is pressed. However to use anything setup in the Unity input manager
    you need to be programming the base code yourself and activate the
    names of those inputs, for example 'shoot1'.

    What I'm trying to achieve is what people have mentioned being able
    to do but no one has yet completely mentioned how they achieved,
    being able to have input keys, like in that link I referenced, functioning,
    because anything else will require programming each action.


    I've done everything in the first 2 videos so that's all done, just not worrying
    about the title of the game in ouya until I can actually get it functioning.
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    PlayMaker is great. I'll add a play maker controller example that you can duplicate to get all the mappings without having to write script.
    ~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].
  • SwiftIllusionSwiftIllusion Posts: 33Member
    That would make my absolute year if you could!

    May I ask when you plan for this to be available?
    Obviously I wouldn't want to cause you a hassle by asking for it to be done immediately,
    but because of the urgency in which I need controller input (I'm trying to enter the
    'create' Ouya competition) I'd just like to be aware of whether I need to continue searching
    for solutions until your absolutely awesome addition comes out ^^;?
  • TristTrist Posts: 71Member

    @tgraupmann: are you the only dev working on the unity integration side of things? if so man I salute you :). One question I have is, could other controller setups not have so much dependency on the SDK? what I mean is if I only want the Ouya SDK without NGUI, or PlayMaker is that feasible? currently trying to get the SDK without NGUI is a no go.

  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    It's Marco Williams and I that work on the OUYA Unity Package. In your case just import everything but the NGUI folder. In the next version the examples will be a separate package.

    The playmaker thing will be a future update.
    ~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].
  • SwiftIllusionSwiftIllusion Posts: 33Member
    @Ayrik-
    Thank you so so very very much Ayrik :D!!!! That has worked for me!!
    I had it running all night and it comes up in the games now so it should be just
    what I need :D. I don't need the In-App purchasing at all yet so no worries
    about that. I'm so happy now! Can finally keep working on the game now :)!

    @tgraupmann
    It's great to hear that your thinking about things like playmaker already,
    I'm much more happy with OUYA than I always feared I wouldn't be after
    the support I've been able to find here and I can't wait for the improvements
    in the future :).
  • 1-PupGames1-PupGames Posts: 6Member
    Thanks so much FelineArts. That was a great start!

    I have found some trouble... that my controller no longer registered in a new scene, (even though it had the OuyaGameObject), but if I left the game and then came back it suddenly worked. Maybe this has been fixed in the brand new update with the DoNotDestroy... 

    So at first, I thought FelineArts's code did not work at all and I couldn't figure out why.  If your controller still isn't registering input... try exiting the app and coming back to it.  The touch pad continued to work even though the button inputs weren't registering.
  • SantaRagioneSantaRagione Posts: 7Member
    I had the same problem ("my controller no longer registered in a new scene but if I left the game and then came back it suddenly worked") and for me removing RT and LT axis input fixed it, no idea why.  
  • TyrusTyrus Posts: 67Member
    @1-PupGames, @SantaRagione,

    Thanks for your posts, guys! Same issue here! I didn't try anything with RT/LT as those buttons are pretty integral to my game being playable. I posted about it here http://forums.ouya.tv/discussion/351/input-stops-working-after-loading-a-new-scene-until-going-to-the-home-screen-and-back#latest

    but it'd be great to know whether the new unity package addresses this issue. Hopefully I'll be able to try that out in my CREATE entry tonight.
  • SantaRagioneSantaRagione Posts: 7Member
    the new unitypackage fixed this problem entirely for me as well as the reload scene issue I had
  • TomPendergrassTomPendergrass Posts: 14Member
    edited January 2013
    I just wanted to extend the biggest thank you ever for your script @FelineArts! I was able to tweak the default case value in the inputManager to appropriately get the left and right joystick values from their respective inputs ("Horizontal" = lAxis.x; "Vertical" = lAxis.y, "Mouse X" = rAxis.x; "Mouse Y" = rAxis.y. I don't have any way to test the apk, but I just know it'll work. again, thank you so much :D
    Post edited by TomPendergrass on
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    edited January 2013
    You should have your initial scene, load a main menu scene, which loads the game scene, which can go back to the main menu scene, which can go back to the game scene. Something like that.

    Make sure that your initial scene has the only OuyaGameObject with Don't Destroy On load.

    In your main scene and game scene there should not be an OuyaGameObject. Make sure your game logic registers the input event in Awake and unregisters it in OnDestroy.
    Post edited by tgraupmann on
    ~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].
  • derkoiderkoi Posts: 20Member
    Hi Tim, any word on the Playmaker actions for OUYA please?
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Ah yes. I did get a hold of a distribution edition of PlayMaker I just haven't made the example yet.
    ~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].
  • derkoiderkoi Posts: 20Member
    Would be awesome if you made them. :)
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Okay so PlayMaker has the ability to call a function on a game object to make a controller button do something. And then we could add a FSM event where you specify the player # and ouya button to see if it's pressed. And if it is pressed that could transition to the next state.
    ~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].
  • derkoiderkoi Posts: 20Member
    Yes that would work, if you need any testers for the actions, i'd love to help. Let me know if you want my skype. We would also need actions for IAPs too.
Sign In or Register to comment.