Search Unity

[Free] Custom Input Manager

Discussion in 'Assets and Asset Store' started by daemon3000, Jan 18, 2014.

  1. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    CONTACT ME
    If I don't answer your message in 1-2 days I probably didn't get a notification about new replies so email me at daemon3000@hotmail.com

    Introduction

    InputManager is a custom input manager that allows you to rebind keys at runtime and abstract input devices(through input configurations) for cross platform input.

    Features
    • Very simple to implement. It has the same public methods and variables as Unity's Input class.
    • Allows you to customize key bindings at runtime.
    • Allows you to use XInput for better controller support.
    • Allows you to convert touch input to axes and buttons on mobile devices.
    • Allows you to bind script methods to various input events(e.g. when the user presses a button or key) through the inspector.
    • Run up to four input configurations at the same time for easy local co-op input handling.
    • Save the key bindings to a file, to PlayerPrefs or anywhere else by implementing a simple interface.
    • Seamless transition from keyboard to gamepad with multiple bindings per input action.
    • Standardized gamepad input. Gamepad profiles map various controllers to a standard set of buttons and axes.
    Platforms
    Works on Windows 7, Windows 8 Desktop, Windows 8 Store, Linux, Mac OSX, WebPlayer and Android(not tested on iOS but it might work).

    Download

    Visit the github page to get InputManager for free and read detailed instructions.

    Getting Started
    For detailed information on how to get started with this plugin visit the Wiki or watch the video tutorial linked below.



    Code Samples
    Key Remap

    Code (CSharp):
    1. // Example 1: Changing axis properties
    2. AxisConfiguration axisConfig = InputManager.GetAxisConfiguration("MoveVertical");
    3. axisConfig.positive = KeyCode.W;
    4. axisConfig.negative = KeyCode.S;
    5. axisConfig.sensitivity = 2.0f;
    6. axisConfig.invert = true;
    7. // The AxisConfiguration class allows you to change any parameter that you can change in the custom editor window
    8.  
    9. // Example 2: Key remap
    10. private void OnGUI()
    11. {
    12.      // Scan for key
    13.      if(GUILayout.Button("Jump"))
    14.     {
    15.         // InputManager.StartKeyScan(KeyScanHandler scanHandler, float timeout, string cancelScanButton, params object[] optional)
    16.         InputManager.StartKeyScan((key, arg) => {
    17.             AxisConfiguration axisConfig = InputManager.GetAxisConfiguration("Jump");
    18.             axisConfig.positive = (key == KeyCode.Backspace) ? KeyCode.None : key;
    19.             return true;
    20.         }, 10.0f, null);
    21.     }
    22.     // Scan for joystick axis
    23.     if(GUILayout.Button("Move"))
    24.     {
    25.         // InputManager.StartJoystickAxisScan(AxisScanHandler scanHandler, int joystick, float  timeout, string cancelScanButton, params object[] optional)
    26.         InputManager.StartJoystickAxisScan((axis, arg) => {
    27.             if(axis >= 0)
    28.             {
    29.                  AxisConfiguration axisConfig = InputManager.GetAxisConfiguration("Move");
    30.                  axisConfig.SetAnalogAxis(0, axis); // Use axisConfig.SetMouseAxis() to change a mouse axis
    31.                  return true;
    32.             }
    33.  
    34.             return false;
    35.         }, 0, 10.0f, null);
    36.     }
    37. }

    Save/Load
    Code (csharp):
    1.  
    2. //    Example 1: Default save and load
    3. InputManager.Save();    //    Saves the configurations in Application.persistentDataPath
    4. InputManager.Load();    //    Loads the configurations from Application.pesistentDataPath
    5.  
    6. InputManager.Save("MyGame/Profile/input_config.xml");        //    Saves the configurations at a custom path
    7. InputManager.Load("MyGame/Profile/input_config.xml");        //    Loads the configurations from a custom path
    8.  
    9. //    Example 2: Saving and loading using PlayerPrefs
    10. private void PlayerPrefsSave()
    11. {
    12.     StringBuilder output = new StringBuilder();
    13.     InputSaverXML saver = new InputSaverXML(output);
    14.     InputManager.Save(saver);
    15.  
    16.     PlayerPerfs.SetString("MyGame.InputConfig", output.ToString());
    17. }
    18.  
    19. private void PlayerPrefsLoad()
    20. {
    21.     if(PlayerPrefs.HasKey("MyGame.InputConfig"))
    22.     {
    23.         string xml = PlayerPrefs.GetString("MyGame.InputConfig");
    24.         using(TextReader reader = new StringReader(xml))
    25.         {
    26.             InputLoaderXML loader = new InputLoaderXML(reader);
    27.             InputManager.Load(loader);
    28.         }
    29.     }
    30. }
    31. //    Alternatively you can create a custom input saver and loader by implementing IInputSaver and IInputLoader
    32.  
    Create input at runtime
    Code (csharp):
    1.  
    2. private void CreateKeyboardConfiguration()
    3. {
    4.     InputManager.CreateInputConfiguration("Keyboard");
    5.  
    6.     //    public static AxisConfiguration CreateDigitalAxis(string configuration, string name, KeyCode positive,
    7.     //                                                      KeyCode negative, float gravity, float sensitivity)
    8.     InputManager.CreateDigitalAxis("Keyboard", "Horizontal", KeyCode.D, KeyCode.A, 3.0f, 3.0f);
    9.     InputManager.CreateDigitalAxis("Keyboard", "Vertical", KeyCode.W, KeyCode.S, 3.0f, 3.0f);
    10.     //    public static AxisConfiguration CreateButton(string configuration, string name, KeyCode key)
    11.     InputManager.CreateButton("Keyboard", "Jump", KeyCode.Space);
    12.  
    13.     InputManager.SetConfiguration("Keyboard");
    14. }
    15.  
    16. private void CreateJoystickConfiguration()
    17. {
    18.     InputManager.CreateInputConfiguration("Joystick");
    19.  
    20.     //    public static AxisConfiguration CreateAnalogAxis(string configuration, string name, int joystick, int axis,
    21.     //                                                     float sensitivity, float deadZone)
    22.     InputManager.CreateAnalogAxis("Joystick", "Horizontal", 0, 0, 1.0f, 0.1f);
    23.     InputManager.CreateAnalogAxis("Joystick", "Vertical", 0, 1, 1.0f, 0.1f);
    24.     InputManager.CreateButton("Joystick", "Jump", KeyCode.JoystickButton0);
    25.  
    26.     InputManager.SetConfiguration("Joystick");
    27. }
    28. //    Note: "CreateButton" and "CreateDigitalAxis" have overloads that take secondary keys
    29.  
    License
    This software is released under the MIT license.
     
    Last edited: Apr 17, 2021
    IEdge, PrimalCoder and shkar-noori like this.
  2. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    The webplayer shows a white rectangle.
     
  3. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Fixed the link. Try again here.

    The web demo is actually the example scene for the project. If it doesn't work just download the project and test it there.
     
    Last edited: Jan 19, 2014
  4. lastprogrammer

    lastprogrammer

    Joined:
    Apr 30, 2011
    Posts:
    166
    Wow, thanks for this. I downloaded it and it works great. I was just thinking about my own solution, but I'll just use this instead. I'm not a fan of the unity input system so this is a godsend.

    I also appreciate the open source so I can change it and modify it for my projects. If I make any thing worthy I'll hand it to you on this thread.

    Thanks again.
     
  5. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    A new update for InputManager is available.

    Changes:
    • Fixed a bug where you couldn't change mouse and joystick axis at runtime
    • InputAdapter addon that manages keyboard and XBox 360 Controller input with seamless transition from one to the other. Test it in the new demo here
    • New example scene to show you how to set up and use the InputAdapter addon
     
  6. lastprogrammer

    lastprogrammer

    Joined:
    Apr 30, 2011
    Posts:
    166
    That's great!

    Can we make this compatible with the OUYA controller? I'm not sure how though. I can take a look at it later.
     
  7. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    If you want to make the InputAdapter addon work with a OUYA controller instead of a Xbox controller you might need to make some changes to the script. The current version of the InputAdaper expects two configurations for the controller because of the differences between the OSX and Windows drivers. If the OUYA controller has the same mapping on both platforms you'll need to edit the InputAdapter script so it expects only one configuration for the controller else you can use it as it is, no changes required.

    To get the OUYA controller mapping for Unity download the helper script from here. You'll need the custom "InputManager.asset" file from the InputManager project.
    Run a test scene with the helper script and press the buttons and the analog sticks one by one to see the KeyCode values and the axis numbers.
     
  8. lastprogrammer

    lastprogrammer

    Joined:
    Apr 30, 2011
    Posts:
    166
    So I've been trying to figure out how to setup where it can read the mouse x and y movement. Can you help?

    Here is the error message:

    Edit: Nevermind. I hadn't imported the asset file into my project settings folder yet.
     
    Last edited: Jan 20, 2014
  9. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    I'm glad you could fix it. With the new update you'll get a dialog when you import InputManager that lets you know you need to replace the file.
     
  10. lastprogrammer

    lastprogrammer

    Joined:
    Apr 30, 2011
    Posts:
    166
    One big improvement to this would be to have the editor render everything inside the Inpector, rather than a new editor window. It would make changes easier that way.
     
  11. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    New updates for InputManager are available.

    Changes from 1.2
    :


    • Undo support for the inspector and the advanced editor
    • Input configurations can now be edited in the inspector
    • Fixed some bugs related to the editor GUI for Unity 4.3

    Changes from 1.1:

    • The Advanced Editor is now able to edit prefabs
    • You now get a warning that lets you know you need to overwrite the input settings
    • Various tweaks and fixes
     
  12. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    74
    Good stuff man! I'll look at adding joystick calibration and the move from the dark side will be complete :)
     
  13. lastprogrammer

    lastprogrammer

    Joined:
    Apr 30, 2011
    Posts:
    166
    Great changes. Working much better having the inspector.
     
  14. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Thanks for the support and feedback.

    A new update for InputManager is available.

    Changes from 1.3:

    • Support for creating and deleting axes at runtime. See code samples in the original post and read the readme file(API category) for more info
     
  15. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
    I love this! Not sure if this is a bug, but when I use the joystick on the right on the Dualshock 3, it returns very strange values, such as when I push it upwards, the camera in game rotates diagonal. Thanks so much for making this open source AND free!
     
  16. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Unfortunately I don't have a Dualshock 3 so I can't test it. Maybe you used wrong values for the sensitivity or dead zone or maybe you have two axis configurations that use the same joystick axis. Create a new project and see what values it returns when using the built-in Input class then compare them with what you get now. Maybe that will give you an idea on how to fix it or maybe there's something wrong with the joystick. Let me know how it turns out so I can patch it if it's a bug.
     
  17. adelphiaUK

    adelphiaUK

    Joined:
    Apr 6, 2014
    Posts:
    28
    Hi there. Firstly I really appreciate you giving me, an "out of work hobbyist", an opportunity to use your code for free but I'm trying to get your code working and I think I'm missing something obvious.

    I'm using VS2013 C# and I'm simply trying to implement your StartJoystickAxisScan which I have as follows...

    Code (csharp):
    1.  
    2.     void OnGUI() {
    3.         if(GUILayout.Button("Move")) {
    4.             InputManager.StartJoystickAxisScan((axis, params object[] arg) => {
    5.                 if(axis >= 0) {
    6.                     AxisConfiguration axisConfig = InputManager.GetAxisConfiguration("Move");
    7.                     axisConfig.SetAnalogAxis(0, axis);
    8.                 }
    9.             }, 0, 10.0f, null);
    10.         }
    11.     }
    12.  
    Unfortunately, I just get an error tool tip over InputManager.StartJoystickAxisScan (and can't compile) stating

    (parameter) int axis​

    Error:
    No overload for method 'StartJoystickAxisScan' takes 1 arguments​

    Please try and point me in the right direction as I've been trying to get my input mapping sorted for over a week now using various methods, and yours looks like the easiest (if I can get it working that is). I hope I'm not being a dumb dumb and have missed something real simple.
     
  18. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    That example is out of date and has some errors. Use this one instead:

    Code (CSharp):
    1. void OnGUI()
    2. {
    3.     if(GUILayout.Button("Move"))
    4.     {
    5.        InputManager.StartJoystickAxisScan((axis, arg) => {
    6.                 if(axis >= 0)
    7.                 {
    8.                     AxisConfiguration axisConfig = InputManager.GetAxisConfiguration("Move");
    9.                     axisConfig.SetAnalogAxis(0, axis);
    10.                     return true;
    11.                 }
    12.  
    13.                 return false;
    14.         }, 0, 10.0f, null);
    15.     }
    16. }
    Let me know if you have other problems and thank you for pointing this out to me.
     
  19. adelphiaUK

    adelphiaUK

    Joined:
    Apr 6, 2014
    Posts:
    28

    Thanks very much! That was driving me nuts, but glad to see it wasn't me ;). You may wish to update your WIKI too as that has the same erroneous example.
     
  20. Alamantus_GameDev

    Alamantus_GameDev

    Joined:
    Mar 12, 2014
    Posts:
    4
    Hi! First of all, thanks so much for this!

    I've tried the example project and it works fine, but I'm having some trouble importing this into my own project. I imported it into the root Assets folder and got a ton of errors saying it didn't know what the InputManager class was (when referencing from my script):
    Assets/Scripts/PlayerControl.cs(70,38): error CS0103: The name `InputManager' does not exist in the current context​

    I'm using Unity 4.5.0

    Help?

    EDIT:
    Solved by adding "using TeamUtility.IO;"
    That should probably be in the instructions on the ReadMe... :)
     
    Last edited: Oct 28, 2014
  21. Rukey4

    Rukey4

    Joined:
    Sep 23, 2012
    Posts:
    73
    Hello,

    Apologies if I'm doing something wrong and it's obvious, but when I run the project provided it has a whole host of errors with every script. Is this because it's updated for 4.6? (Looking for features I don't have, baring in mind I'm running 4.3, I don't like updating anything mid-way through a project).

    The first error I get is here:

    "Assets/InputManager/Addons/UIInputModules/StandaloneInputModule.cs(32,46): error CS0246: The type or namespace name `PointerInputModule' could not be found. Are you missing a using directive or an assembly reference?"

    I get a whole host there after, is there a previous version available?

    Thanks for your time!
     
  22. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Yes, it is because the scripts are updated for 4.6. To use it in a lower version delete the UIInputModules folder located in the InputManager/Addons folder and the UI example(03 - UI) located in Assets/InputManager/Examples.

    Let me know if that doesn't fix your problems.
     
  23. Rukey4

    Rukey4

    Joined:
    Sep 23, 2012
    Posts:
    73
    I appreciate the reply, thanks.

    I've deleted the two folders you mentioned and I now get this error:

    "Assets/InputManager/Addons/JoystickMapping/Runtime/MappingWizard.cs(42,18): error CS0246: The type or namespace name `TooltipAttribute' could not be found. Are you missing a using directive or an assembly reference?"

    Located: "/Addons/JoystickMapping/Runtime/MappingWizard"

    Thanks again,
     
  24. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    first of all thank you for your contribution, I think the my main concern when i made a custom input manager was performance, as checking for XInput and Generic gamepads alongside the keyboard and mouse were killing the performance a bit, but now after a couple of projects and years I've come to a solution that my InputManager takes nearly no performance, i would like to know about your performance too, and a realtime debugger is a must, and I really like the simple editor window, but an editor that makes you feel a little more modern is always welcome [Screenshot below], once a again thank you for your contribution, you save a lot of people a lot of time.
     
  25. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    @Rukey4 go to the Github page and get the newest version. I fixed the Unity 4.3 related issues.

    @Shkarface Noori I didn't benchmark it so I don't know how it compares to other input solutions.
     
    shkar-noori likes this.
  26. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    lol i made a dumb mistake
    - cleared this huge wall of text - (wouldnt really help anyone, rookie mistake)
     
    Last edited: Aug 31, 2015
  27. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    What values do InputManager.GetAxis("Horizontal") and InputManager.GetAxis("Vertical") return? Make sure the axis sensitivity and gravity are greater than zero and that the axis type is Digital Axis or Analog Axis(for joysticks).
     
  28. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    THANKS ALOT!! for this code!! its amazing!! .. thanks for the help!
     
    Last edited: Aug 31, 2015
  29. Wonka45v

    Wonka45v

    Joined:
    Dec 19, 2014
    Posts:
    8
    So how do i import it to my project? I downloaded thezip, i put the Input Manager master folder to unity project, then i exported input manager folder as package. Then i deleted the input manager folder and then downloaded the unitypackage that was made...

    It just gives me errors... How do i set this up????



    Im using Unity 4.6 free version


    EDIT# ok i fixed the errors by deleting the ui addon, but i have 4.6??

    EDIT2#
    How will i start using this????
     
    Last edited: Dec 30, 2014
  30. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    • Download the project from Github. The zip file is a Unity project that contains the plugin.
    • Open the project, select the "InputManager" folder, right-click on it and export the folder as a unity package.
    • Close the input manager project and open your game project then drag the unity package in the Project panel to import it.
    • If you are using a Unity version lower than 4.6 don't import the examples and UIInputModules addon.
    • If your game project contains any scripts, open the project in MonoDevelop/Visual Studio and replace all calls to the built-in Input class with calls to the InputManager class that comes with the plugin. Make sure you add using TeamUtility.IO; at the top of the scripts to include the namespace where the InputManager class is.
    • Once everything is set up go to the TeamUtility > InputManager menu and select Open Advanced Editor.
    • An input manager instance will be created and you will be prompted to overwrite your project's input settings.
    • Use the advanced editor to set up your input axes/buttons.
    You should only have on instance of the input manager in your game. Add it in the first scene and enable Dont Destroy On Load in the inspector. You should also enable Ignore Timescale if you pause the game by setting the timescale to zero.

    If you want to use the input manager with the Unity 4.6 UI make sure you go to the TeamUtility > InputManager menu and select Fix Event System. This will require the UIInputModules addon.
     
  31. Wonka45v

    Wonka45v

    Joined:
    Dec 19, 2014
    Posts:
    8
    Thanks for clearing it up...

    So this works pretty much same like unitys own input?


    I have to get into this and get to know how to implement keyremapping on runtime, i am still quite not sure how its done..

    ps. Does this mean i cant use Unitys Input to anything? I need the Input.mouseposition...
    [EDIT# it seems to work, but is it suppose to?]


    By the way, how would i do that in the menu it shows in custom font, the key that was remapped?

    Really awesome! Thank you for making it!
     
    Last edited: Dec 30, 2014
  32. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    You don't have to use the built-in Input class. The InputManager class that comes with the plugin has has all the methods and fields you have by default in Unity plus some specific ones for rebinding keys, creating input configurations at runtime, saving and loading, etc.

    Take a look at the controls menu example and the Wiki for more information on how to rebind keys at runtime.
     
  33. Wonka45v

    Wonka45v

    Joined:
    Dec 19, 2014
    Posts:
    8
    Ah okay! Awesome!


    So how would i do with 4.6 UI system the same that you had in the demo, where you press the "Scan" it shows the key that was pressed? And the saving made changes?



    I have the 4.6 free version but im still having errors when having the ui addon... And i havent found the Fix Event System button cause the Team Utility window wont show up before deleting the uiaddon....

    Errors are something like; Cannot convert 'object' expression type to type 'UnityEngine.GameObject'
    or Type 'UnityEngine.EventSystems.ExecuteEvents' does not contain name for 'intializePotentialDrag'
     
    Last edited: Dec 31, 2014
  34. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Go to Github and get the latest changes. The UI input module addon was outdated so I fixed it.
    For key rebinding look at the controls menu example, more specifically at the RebindInput script that comes with it.
     
  35. Wonka45v

    Wonka45v

    Joined:
    Dec 19, 2014
    Posts:
    8
    I downloaded again... still same erros.. am i doing something wrong?

    I downloaded the zip again in here: https://github.com/daemon3000/InputManager

    then i went to unity open project -> open other -> where i extracted the zip -> i open the project -> then in asset folder there is the InputManager folder-> i right click on it -> extract package -> to desktop -> then i open new project -> import the package -> console has errors... until i delete the ui addon folder..

    Errors are like : (Unity.Engine.EventSystems.PointerInputModule.MouseState does not contain definition for GetButtonState)

    Sorry for bothering, but I would really like to use this with new 4.6 ui! :D



    - Version is 4.6 0b20
     
    Last edited: Dec 31, 2014
  36. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Are you using the beta version? Please update to the latest 4.6 release.
     
  37. Wonka45v

    Wonka45v

    Joined:
    Dec 19, 2014
    Posts:
    8
    Ohhhhh.....

    i feel stupid now...

    I thought always that i had the latest version, cause "check for updates" said that i had the latest version, but guess you have to redownload it when its fully released...

    Well it works perfectly now!

    Thanks again!
     
  38. Wonka45v

    Wonka45v

    Joined:
    Dec 19, 2014
    Posts:
    8
    By the way, are the example ui scripts free to use for own projects? :D
     
  39. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    Yes, you can use the scripts. They are released under the same license as the rest of the code(MIT license). The 2D assets I used in the examples are released under public domain and you can get them from http://opengameart.org/content/ui-pack
     
  40. HarlequinHQ

    HarlequinHQ

    Joined:
    Apr 27, 2014
    Posts:
    1
    I'm facing a small problem in the demo scene, after I rebound the keys and resumed the game, the new keys does not seem to take into effect. Only when I reset the keys to the WASD default
     
  41. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    There was a bug in one of the example scripts. It's fixed now. Go to Github and get the newest changes. When you run the example make sure you reset to the default binding first. The example saves the changes on your computer and when you'll run the fixed example it might load changes that have been corrupted by the bug.
     
  42. Exploder1010

    Exploder1010

    Joined:
    Jul 19, 2014
    Posts:
    6
    I was having trouble finding the Team Utility menu described but then I opened the StandaloneInputModule Import Settings of the UIInputModules folder and it appeared in my menu. I don't know if that was an obvious step because this is the first real plugin I have installed for unity, but if it wasn't I think that it would make a nice addition to this page.

    Aside from that there are only a few things im not sure of. When I first started using it it threw 4 errors that "Submit" "Cancel" "MenuHorizontal" and "MenuVertical" were missing, so I made those axes and then the error reports stopped. Is this something I should be concerned about, or is my fix fine?

    And secondly (and this is a really minor thing) is there a good way to have an axis reach its target number immediately, without just setting the gravity/ sensitivity to 100?

    Anyways thank you so much daemon3000, this plugin adds a whole new level of professionalism to unity.
     
    Last edited: Feb 17, 2015
  43. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    You need to click on the menu bar to refresh it.

    If you use the Unity 4.6 UI these four axes are required(for keyboard and gamepad navigation).

    Use InputManager.GetAxisRaw for no smoothing.
     
  44. Exploder1010

    Exploder1010

    Joined:
    Jul 19, 2014
    Posts:
    6
    Oh ok that answers everything, thanks!
     
  45. Ka92

    Ka92

    Joined:
    Oct 27, 2014
    Posts:
    2
    Hey, friend!
    I think you did quite an awesome job. It works very fluently but in the new Unity version 5 I have an error about UnityEditor namespace could not be found when I try to build the project.

    I understand Unity5 is quite new but if you ever run into that problem and find a fix please share.

    Thanks for all your efforts.
     
  46. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    What platform are you trying to build for?
     
  47. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    I updated the plugin. It now works with Unity 5.
     
    Ka92 and Exploder1010 like this.
  48. subtledark

    subtledark

    Joined:
    Feb 11, 2014
    Posts:
    4
    daemon3000, Thank you for this.

    Just one problem. Looks like Cursor.visible is not backward compatible to pre 5 versions of Unity.

    I'm on: 4.6.3f1

    Opening the project I get:
    `UnityEngine.Cursor' does not contain a definition for `visible'
    on lines 578, 586, 633
    of InputAdapter.cs

    As a test, I commented out the Cursor.visible references and replaced with:
    Screen.showCursor

    Everything then compiled. Not sure that provides the same functionality, I just found that Google'ing quickly.
     
  49. daemon3000

    daemon3000

    Joined:
    Aug 13, 2012
    Posts:
    139
    The quick fix for that is to do something like:
    Code (CSharp):
    1. #if UNITY_5
    2.     Cursor.visible = true;    //    Or whatever value it was
    3. #else
    4.     Screen.showCursor = true;
    5. #endif
    I'll make sure to patch it in as soon as possible.
     
  50. subtledark

    subtledark

    Joined:
    Feb 11, 2014
    Posts:
    4