Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by tfunk · Aug 23, 2015 at 06:51 PM · inputinputmanagercrossplatform

Cross-Platform Input

How best to handle differences between Input when publishing a game cross-platform? I am trying to handle input from an Xbox 360 controller, but the buttons and axes are handled so differently from OS to OS that it seems unmanageable. And I can't seem to find an easy way to swap out the InputManager depending on the current platform. Any thoughts?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by pRoFlT · Aug 24, 2015 at 05:08 AM

I'm dealing with this for my app right now.

so far i have a playerController.cs class and use #IF UNITY_ANDROID or #IF UNITY_STANDALONE

these are compiler statements and will block out code from being compiled to these systems.

I dont have any good examples but you could develop a controller class that has the functionality you need and then write separate controls for Playstation and XBOX. That is just an idea.

I know there are controller settings built into unity that are meant to help with this kind of thing. maybe you should do some more searching online as someone has surely come up with an answer better then mine. :)

here is something https://www.youtube.com/watch?v=uPrqvisEdpU

or you could buy an asset --> https://www.assetstore.unity3d.com/en/#!/content/5713 $10 bucks. i wouldn't pay it myself. but if you are struggling maybe it is an answer for you.

heres one for $30 https://www.assetstore.unity3d.com/en/#!/content/14695 looks nicer.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by tfunk · Aug 25, 2015 at 05:07 PM

Thanks! I guess I was hoping I wouldn't have to have code filled with a bunch of compiler macros, but I guess that's just the way it's done?

So it seems like these addons are circumventing the default InputManager altogether? I'll do some digging into these and keep my eyes out for something else too...if possible I'd like to still use the InputManager Unity provides, as it hooks up easily with the UI system and all that jazz..

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by sutartmelson · Dec 18, 2016 at 10:02 PM

I wrote some c# code to manage xbox controllers across multiple platforms. I think it does exactly what you're looking for. Try it out and contribute if you can improve it!

ControllerManager

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UNITY no longer detecting XBOX360 controller input,XBOX 360 controller no longer working with UNITY 0 Answers

CrossPlatformInput GetAxis("Vertical") behave differently from Input.GetAxis("Vertical") !? 0 Answers

Do I need to use the Input Manager to register all input axes? 0 Answers

JoyCons not working with vJoy 0 Answers

Axes in the Input Manager are blank 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges