I think my guess about delegates is wrong. I think the problem is that somehow java is not initializing correctly - so there's no input to listen to*. I'm gonna look more into that.
*Although that's weird because I do get "trackpad tap" as Input.GetButtonDown("Fire1") in Unity...
Last night I changed the way we handle button press events. You no longer need to run a check in the UPDATE() each time to check for button press events. It is true even driven now.
Please email tgraupmann for the most recent update and watch the video below to see how it all works.
OK I it's finally working! As suspected, the problem was me being a dumbass - I hadn't added the OuyaGameObject to my scene, which was why "Show Controller" worked and nothing else did. *forehead slap*
@HashbangGames - I don't have time right now to review your videos but did you mention that in there? I followed along with your (excellent) tutorial, but somehow ended up without the OuyaGameObject in my scene.
@gribbly hey you can ping me tonight after 5:00 pm pst ( marco at hashbanggames.com ) on gtalk and we can screenshare and get you 100% functional. let me know if you want to do that.
Post edited by HashbangGames on
Marco Williams
Hashbang Games
Gravi is available on the OUYA look for it in the store!
@gribbly great! Glad it's working. You will still want to watch the new video when you have time, and get the next update from Tim. 2 words. "Event Driven" prior to this last update, we required you to check in the "update()" OuyaInputManager.getButtonDown("O"), like this. it was state managed returning true or false. I left this available if it was ever needed, but added an event call when button down state and button up states are called. therefore, you can just subscribe to the event and handle your button press events. Your code will only run when the event is triggered.
Anyways, again glad you got it working.
Marco Williams
Hashbang Games
Gravi is available on the OUYA look for it in the store!
Hey everyone, not sure if you can help, got a demo running thanks to Tim's latest and greatest code. The game is a FPS and I'm having issues translating the right joystick values to work like mouselook or in my case my mobile code for looking around. Anyone have any tips? Not used to programming for controllers.
I really need to be able to use Unity input, however I've only been able to achieve this so far by deleting the android folder as you suggest and not having the ouyagameobject in the scene. However when I do that, the game can crash in less than a minute after it has started.
You mention ""onKeyDown", "onKeyUp", etc" but what are the exact details? Would it be possible to get a copy of your exact text for the file, as some people have said you need to change "public class OuyaUnityApplication extends Activity" to "public class OuyaUnityApplication extends UnityPlayerActivity", but that doesn't work either. When you comment out the above things, do you still have the ouyagameobject in your scene?
I've been loosing my mind with the constant tests and experiments trying to get this to work based on everything I could find in these forums, I'd really appreciate a solution as soon as possible ^^;
As of tonight the input is working good. We just have to tie it into the existing examples. I have to fix the JNI stuff and then we can push it out. Stay tuned...
@SwiftIllusion: If you still want to use Unity's Input and InputManager, here's what I've used to get it working:
Change OuyaUnityApplication to extend from UnityPlayerActivity instead of Activity.
Comment out everything in the onCreate method, leaving only the call to super.onCreate
Comment out the remaining methods in the file.
This seems to be working well for me, but it's unknown how much longer this will be a viable solution as the ODK and Unity plugin progresses. But it should at least get you started.
@VAMflax: Yes, it does "get rid of them" due to the simple fact that you're not really using the Unity plugin for input, but as @tgraupmann said, the OUYA Unity plugin itself is being updated to use pinned memory to fix this exact issue.
Thank you for your Suggestion Miniboss1232 :). However sadly this solution didn't work for me. This is the final appearance of the "OuyaUnityApplication.java" file- http://pastebin.com/3jffx938 I've also got the OuyaGameObject in the scene, I imagine I should? I'm not sure if I misunderstood anything you said but it isn't working for me, though I've been told a solution now that does work- just that it removes the ODK, but I don't really need the store or anything like that at the moment so that'll be fine unless I just missed something.
Comments
1) Ran "Show Controller" and captured the logcat output. Verified that controller input worked.
2) Ran my game and captured the logcat output. Verified that controller input doesn't work.
3) Diffed the logs. Found a huge difference!
I think my guess about delegates is wrong. I think the problem is that somehow java is not initializing correctly - so there's no input to listen to*. I'm gonna look more into that.
*Although that's weird because I do get "trackpad tap" as Input.GetButtonDown("Fire1") in Unity...
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].
My OuyaUnityApplication is:
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
COOL!
Tonight after work I am going to sit down and dive into the controller handling,
any idea when the next update will be released? (roughly) (i.e. days or weeks?)
thanks,
Brian
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
@HashbangGames - I don't have time right now to review your videos but did you mention that in there? I followed along with your (excellent) tutorial, but somehow ended up without the OuyaGameObject in my scene.
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
Anyways, again glad you got it working.
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
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].
However when I do that, the game can crash in less than a minute after it has started.
You mention ""onKeyDown", "onKeyUp", etc" but what are the exact details? Would it be possible to get a copy of your exact text for the file, as some people have said you need to change
"public class OuyaUnityApplication extends Activity" to
"public class OuyaUnityApplication extends UnityPlayerActivity", but that doesn't work either.
When you comment out the above things, do you still have the ouyagameobject in your scene?
I've been loosing my mind with the constant tests and experiments trying to get this to work based on everything I could find in these forums, I'd really appreciate a solution as soon as possible ^^;
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].
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].
However sadly this solution didn't work for me.
This is the final appearance of the "OuyaUnityApplication.java" file-
http://pastebin.com/3jffx938
I've also got the OuyaGameObject in the scene, I imagine I should?
I'm not sure if I misunderstood anything you said but it isn't
working for me, though I've been told a solution now that does work-
just that it removes the ODK, but I don't really need the store or
anything like that at the moment so that'll be fine unless I just
missed something.
http://forums.ouya.tv/discussion/488/controller-lag-and-inaccuracy#latest
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].