Git Product home page Git Product logo

inputmanager's Introduction

Introduction

InputManager is a custom input manager for Unity that allows you to rebind keys at runtime and abstract input devices 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

Compatible with Windows Desktop, Windows Store, Linux, Mac OSX and Android(not tested on iOS but it probably works). Requires the latest version of Unity.

Getting Started

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

Unity - Custom Input Manager Setup Tutorial

Addons

XInputDotNet

This addon allows you to use XInput for controller support instead of the Unity input system. Only available on Windows platforms.

UI Input Module

Custom standalone input module for the UI system introduced in Unity 4.6.

Input Events

This addon allows you to bind script methods to various input events(e.g. when the user presses a button or key) through the inspector.

For more information about the addons visit the Wiki.

License

This software is released under the MIT license. You can find a copy of the license in the LICENSE file included in the InputManager source distribution.

Contributors

inputmanager's People

Contributors

camsmithcamsmith avatar daemon3000 avatar reberzon avatar z3nth10n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inputmanager's Issues

Multiple controllers and cross-platform issue

This is a non-critical question. Mostly for curiosity.

This is my configuration :

image

My final purpose : make the game work with 4 controllers on Windows, Linux and Mac. Right now, the game works fine on Windows. It may also work correctly on other platforms with only one controller : the one defined in the Input Adapter. But I guess that the 3 other controllers are not gonna work.

At first I thought that I could use 4 input Adapters, each one assigned to a specific player, but it's a singleton.

So I'm quite stuck here.

Dual shift key issue

Unity has had a bug in using dual shift keys for 10 years already , I finally thought i will look for some alternative solution because they are never fixing it, while testing your first sample seen "01 - Controls Menu" "Example_1" I bind a new binding to use multiple shift keys to test , i made forward be left shift and one of the horizontals be right shift. Just to find out you custom input system suffers from the very same bug as unity. The bug is press the first shift , all is good , press the second shift while holding the first shift, all is good , now release the second shift - all is not good!!. The key release is not picked up. When you relase the first shift now you will see it fire the release for both shifts. If does not matter in what order you do this , leading left or leading right , the second pressed shift key release is not detected but when the first pressed shift is released ( if the second shift was pressed during its down time ) then both release events are fired.

So that sucks, I dont know how your tool is built but it is now obvious it is not a serious low level plugin capturing key events itself .. it is using the broken Unity system somehow. How else can you have the exact same bug? This is not keyboard ghosting , dual shift works fine in any other application except for unity and it has being broken like this and forum posts and bug reports and still they dont fix it.

Anyway cool you have some free tool , i would have been awesome if it worked , just perhaps put a disclaimer up somewhere in the info that your tool suffers from the same input bugs as unity

XmlException

hi! i use GoogleAnalytics and report this issue. but, i can not be reproduced.

XmlException: expected '>' (3E) but found 'EOF' (FFFFFFFF) Line 127, position 14. Mono.Xml2.XmlTextReader.Expect (Int32 expected) Mono.Xml2.XmlTextReader.ReadStartTag () Mono.Xml2.XmlTextReader.ReadContent () Mono.Xml2.XmlTextReader.Read () System.Xml.XmlTextReader.Read () TeamUtility.IO.InputLoaderXML.ReadAxisConfiguration (System.Xml.XmlReader reader) TeamUtility.IO.InputLoaderXML.ReadInputConfiguration (System.Xml.XmlReader reader) TeamUtility.IO.InputLoaderXML.Load () TeamUtility.IO.InputManager.Load (IInputLoader inputLoader) GoogleAnalyticsV4:HandleException(String, String, LogType) UnityEngine.Application:CallLogCallback(String, String, LogType, Boolean)

thanks!
i want to load this xml file.
sample.txt

OnLevelWasLoaded was found on PauseManager

Hi!
The plugin is very cool, and works find but it keeps logging this warning message in the console:

OnLevelWasLoaded was found on PauseManager
This message has been deprecated and will be removed in a later version of Unity.
Add a delegate to SceneManager.sceneLoaded instead to get notifications after scene loading has completed

NullReferenceException when loading project with Advance Menu docked

If you dock the Adv. Input window and relaunch the project it will create an error.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorStyles.get_label () (at C:/buildslave/unity/build/Editor/Mono/GUI/EditorStyles.cs:11)

Can be prevented by not docking.

Unfortunate as I would like to dock this.

Input Adapter doesn't switch from Keyboard to Gamepad if Left or Right sticks are used

In the UpdateInputDevice ()function the follwing check is done:
if(InputManager.AnyInput(_joystickConfiguration))

When trying to switch from KeyboardAndMouse to Gamepad, this check fails to detect the left or right stick axes on the xbox 360 controller. This creates a jarring user experience when users try to navigate a menu, for example. It however detects triggers and the dpad just fine.

Here's a hacky fix:
if(InputManager.AnyInput(_joystickConfiguration))
{
SetInputDevice(InputDevice.Joystick);
}
else
{
var xAx = Input.GetAxisRaw ("joy_0_axis_0");
var yAx = Input.GetAxisRaw ("joy_0_axis_1");
if ( Mathf.Abs(xAx) > 0.5f || Mathf.Abs(yAx) > 0.5f)
{
SetInputDevice(InputDevice.Joystick);
}
}

DelayedIntField is better than IntField

I've been squeezing my mind because I has some problem editing Axis from InputManager, because, they were deleted when I edited their sizes. I wasn't testing some bools, but searching in the Unity ScriptReference I see this:

https://docs.unity3d.com/ScriptReference/EditorGUILayout.DelayedIntField.html

@daemon3000 I suggest you to use them. The main problem here, is that if you are editing them, and you want to edit the value from 12 to 13, when you erase the 2 to write a 3, you resize it to 1, when you write 13, you have 12 values copied from the first value.

I had make some changes to your InputManagerEditor.cs. I forked and edit it, thanks!

Pull request: #30

PD: Maybe there are a lot of changes, but this is caused because of Visual Studio.

Getting Mouse cursor's to world point

Normally, we'd do Camera.main.ScreenToWorldPoint(Input.mouse.Position) (link) to get the world position.

I don't think this feature is implemented yet. Can we ask for this feature? Thanks

[Edit} I realized that I could do it by getting the Mouse axis first for both X and Y then cast a ray for the z axis.

Problems with the EventSystem

First off, thank so much for this Manager. It is exactly what I've been looking into for awhile.

Second, is the manager meant to work with Unity's 4.6 UI update? I am able to create an InputManager and adjust my scripts to work with the new input. My problem comes with the EventSystem object that is created with the new UI system. I am receiving the following error on every frame:

UnityException: Input Axis Horizontal is not setup.
To change the input settings use: Edit -> Project Settings -> Input
UnityEngine.EventSystems.StandaloneInputModule.ShouldActivateModule () (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/InputModules/StandaloneInputModule.cs:109)
UnityEngine.EventSystems.EventSystem.Update () (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/EventSystem.cs:159)

Even though I do have a Horizontal axis setup in the new InputManager, the GUI system doesn't seem to recognize it. Aside from the errors, this essentially breaks anything created in the new 4.6 GUI.

Thanks for your help on this.

Reloading scripts during play mode corrupts InputManager and InputAdapter internal state

This issue can be tough, since usually not everybody writes his game 100% himself.
Currently, InputManager cannot survive script reload during play mode which makes it impossible for use during PlayMode and concurrent code tweaking.
I workarounded the issue by using the inputManager only during runtime and plain old Input.Get calls during editor.

All my other scripts and custom scripts survive reload successfully.
In order to survive a Assembly Reload during Play Mode without corrupting the entire projects of users, you should overall, only use serialized attributes.

If you indeed need to use private nonserialized, then handle the ReInitialization in OnEnable! If you properly reinit, user's playmode tweaking in code will not be interrupted.

Switching scenes with InputManager docked may cause problems

When there is docked InputManager edit window, and you switch scenes, for example, game to example scene, InputManager obviously throws unhandled exceptions. This bug is valid for about 1 year, and sometimes is extreme annoyance to overcome.

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[TeamUtility.IO.InputConfiguration].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
TeamUtilityEditor.IO.AdvancedInputEditor.DisplayMainPanel () (at Assets/InputManager/Source/Editor/AdvancedInputEditor.cs:867)
TeamUtilityEditor.IO.AdvancedInputEditor.OnGUI () (at Assets/InputManager/Source/Editor/AdvancedInputEditor.cs:593)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Rebinding Example broken.

I downloaded the library and went to the rebinding example because that's what I'm planning on using in my game.

To my surprise when I clicked on the buttons for rebinding one of the inputs... nothing seemed to happen.
I dove into the source code to find the error and poked around a fair bit. Eventually I found myself in the InputManager.Update() function where I found that when it was supposed to scan for input it just went straight to calling StopInputScan() which passes along KeyCode.None to _scanHandler.

That results in the scan result instantly cancelling on itself and that functionality being completely broken. It seems this bug was introduced in d6c3326 .

I changed StopInputScan() to ScanInput() and then the example worked just as expected, though I have a feeling that this isn't the correct fix for this problem. Perhaps reverting that small section to what was changed in that commit would fix it?

Use uscaledTimeDelta for Axis Input

First of all, hundreds of thanks for this library. It has a long way to go before it becomes stable, but it is a much better solution than the default InputManager.

Now to the issue, input handling should be independent of the time scale. Setting the timeScale to 0 (e.g. for pausing) causes axes to yield 0-s, I have not tried to see what happens when setting it to a negative number or a fraction, but I am sure the result wouldn't be what most people expect.

Please, replace Time.deltaTime with Time.unscaledDeltaTime in AxisConfiguration.cs.

Rebind Input timer not working?

Hi, first off a big thanks for creating this! Such an amazing tool.

I've studied your Controls Menu example to try and implement my own key rebinding menu. I have implemented what I believe to be the same setup as the Controls Menu example and have not edited any of the scripts supplied. When testing, the 'button' that starts the scanner automatically registers the mouse click as the newly binded key, when I'm expecting the timer to start to allow me to select a key from the keyboard.

The new key bindings remain in different scenes, so I'm assuming I'm missing a tiny detail that might not be so obvious in the Controls Menu example scene. I have tried editing the timeout field of the RebindInput script, but with no changes in result. The only error Unity is giving me is a warning that there are two EventSystems in the scene.

I might be missing something silly, but any help would be greatly appreciated :)

rebindinputsetup

GetButtonDown returns true for all PlayerIDs

First, a big thank you for this project, which helped me a lot with my local-crossplatform-multiplayer proof of concept ! It really prevents a huge pain in the ass for me.

Unfortunately, I think I have a problem. Until now, I only used Axis inputs like sticks and triggers of the xbox 360 controller. It worked like a charm. But now, I wanna use the buttons. And it feels like the input manager cannot detect which plays presses a given button.

Here is my input manager conf :

image

Here is my input configuration :
image

Now, I have this very small script in an empty game object on my scene :

    void Update() {
        PlayerID[] players = new PlayerID[] { PlayerID.One, PlayerID.Two, PlayerID.Three, PlayerID.Four };
        foreach(PlayerID playerId in players) {
            if (TeamUtility.IO.InputManager.GetButtonDown("Jump", playerId)) {
                Debug.Log(playerId.ToString());
            }
        }
    }

Now, in test mode, when I press the Jump button on my first controller, I expect this trace :

One

But here is what really happens :

One
Two
Three
Four

I am new to unity, I may be doing something wrong.

Thank you in advance !

Special buttons like Control does not work

From what I understand you should be able to bind a key like "space", by typing in the normal Unity keycode for "space".
This I currently can't get working with LeftControl, LeftShift and so on. As well as Keypad0,1,2...

Half the wiki doesn't work

Half of the Wiki for this plugin don't actually load pages and just redirect to the main wiki page. Is this intentional? It's frustrating not having any documentation other than the wiki, half of which doesn't even work.

InputModule Issue

When trying to navigate fast in menus the allow bool doesnt trigger and you have to wait for m_nextaction.

Here is a way to solve it:

    private bool AllowMoveEventProcessing(float time)
    {
        bool allow |= InputManager.GetKeyDown(InputManager.GetAxisConfiguration(m_configuration,m_VerticalAxis).positive);
        allow |= InputManager.GetKeyDown(InputManager.GetAxisConfiguration(m_configuration, m_HorizontalAxis).negative);
        allow |= InputManager.GetKeyDown(InputManager.GetAxisConfiguration(m_configuration, m_VerticalAxis).negative);
        allow |= InputManager.GetKeyDown(InputManager.GetAxisConfiguration(m_configuration, m_HorizontalAxis).positive);
        allow |= (time > m_NextAction);
        return allow;
    }

I use m_configuration as a public string, so you can put the right configuration depending on controller.

If someone find a cleaner way to do it, feel free to post =).

Missing documentation

It feels like this documentation is half-finished at best. Nothing works, and I keep getting complains about a gamepad adapter? Which I can't find anything about in the docs, or the examples.

Edit:
Seems like gamepad input is just broken. Too bad, this project seemed promising.

Something on the XInput doesnt seem to be working on 2018.2

On Unity 2018.2.21f1

InvalidOperationException: Stack empty.
System.Collections.Generic.Stack1[T].ThrowForEmptyStack () (at <ac210d81537245bc838518cc8e845861>:0) System.Collections.Generic.Stack1[T].Pop () (at :0)
UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.EvaluateBool (System.String expression) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:284)
UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.EvaluateBooleanExpression (System.String expression) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:250)
UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.EvaluateDefine (System.String expr, System.Collections.Generic.ICollection1[T] defines) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:241) UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.RemoveUnusedDefines (System.String source, System.Collections.Generic.List1[T] defines) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:182)
UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.RemoveIfDefs (System.String source, System.Collections.Generic.IEnumerable`1[T] defines) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:159)
UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.GetNamespace (System.String sourceCode, System.String className, System.String[] defines) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:42)
Rethrow as IllegalNamespaceParsing: Searching for classname: 'XInputDotNetAdapter' caused error in CSharpNameParser
UnityEditor.Scripting.ScriptCompilation.CSharpNamespaceParser.GetNamespace (System.String sourceCode, System.String className, System.String[] defines) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CSharpNamespaceParser.cs:48)
UnityEditor.Scripting.Compilers.CSharpLanguage.GetNamespaceNewRuntime (System.String filePath, System.String definedSymbols, System.String[] defines) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/CSharpLanguage.cs:64)
UnityEditor.Scripting.Compilers.CSharpLanguage.GetNamespace (System.String filePath, System.String definedSymbols) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/CSharpLanguage.cs:107)
UnityEditor.Scripting.ScriptCompilers.GetNamespace (System.String file, System.String definedSymbols) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilers.cs:101)

This error goes on actual projects an also on the fresh install one Also there's some problems with packages when trying to import the project.
Capture

But it might be me being a noob IDK :)

Is it possible to "fake" an axis

Is it possible to like set an axis value for that current frame to something of your likening? This would really be useful for platforms like mobile where you could set the axis value when for example you are tilting your phone. Something like this for example: InpitManager.SetAxisValue("Horizontal", 0.9);

This would really really really be useful. If you could use it for 1 frame as example, or set it for always, it could really be handy for cross platform inputs or other ways to manipulate the axis

DPAD error

I'm getting errors where the DPAD inputs are trying to be received by the input adapter, but they only give an error if you didn't mention the DPAD inputs in your own custom input file. Deleting some code in the script fixes it (the part where the DPAD input gets requested).

Using InputManager with Standalone Input Module

So I am using the new Unity 4.6.x UI, which I believe added the EventSystem and Standalone Input Module to the scene automatically.

I've created my Input Manager and overridden Unity's standard Input Manager with this custom one. However, I get errors originating from my Standalone Input Module that my axes "Horizontal" and "Vertical" "are not setup" even though I have defined them in the Input Editor.

It appears that by disabling the Standalone Input Module my UI Clicks cease to work and buttons do not function. Do you know of a way to make Unity's SIM work with this InputManager/recognize my axes, or is there another workaround?

Discrepancy between UI and code when working with axes

When working with axes, the axis variable of the AxisConfiguration is off by one.
The UI says that the mouse wheel is the third axis, but the code returns a 2 when accessing it. The included joystick mapping explorer tells you that the XBox 360 controller uses the fourth and fifth axis for the right stick, but the code return 3 and 4 respectively.

I haven't made a patch, because I'm not really familiar with the code base and am unsure as to whether changing the numbering to start at 1 instead of 0 would break something elsewhere.
But in order to prevent confusion, the UI and the variable should be consistent. (Besides that, having a '0-th' axis doesn't make a whole lot of sense.)

If updating the data-structure is out of the question (breaking backwards compatibility for example), I'd propose to make the axis variable private (or at the very least internal) and implement a getter like this:

public int GetAxisNumber() {
    return axis + 1;
}

Advanced Editor Refocus field glitch

Unity 5: Advanced editor: When refocusing a control in the left tree, on the right, the text field still shows old key's text instead of the new key.

E.g. create new default config, click Horizontal from the left, select and renale it to "Strafe", then select the Vertical one and notice the glitch.

Editor Resources should be under the editor folder

There are two Resource folders:

InputManager/Assets/InputManager/Source/Resources
InputManager/Assets/InputManager/Addons/UIInputModule/Resources

They're only accessed from editor code, so they should be under Editor so that they aren't loaded in standalone games:

InputManager/Assets/InputManager/Source/Editor/Resources
InputManager/Assets/InputManager/Addons/UIInputModule/Editor/Resources

Otherwise, each user needs to strip them out themselves to reduce the cost of their resource bundle.

New Action gets lost

When I add a new action to the InputManager it gets lost when I press play. I don't understand the process how this is supposed to work. I try to add an axis for the mouse wheel.

When I try to add it manually it still does not work:
private void Start()
{
InputManager.CreateMouseAxis("KeyboardAndMouse", "MouseWheel", 3, 1f);
}

The action does not show up in the InputEditor and I get an error:
An axis named 'MouseWheel' does not exist in the active input configuration for player One

InputManager.IsScanning is execution order dependent

Example code:

if(!InputManager.IsScanning) {
    if(InputManager.GetButtonDown("Cancel")) {
        // do stuff for cancel only if it is not scan cancel
    }
}

Here two possible results of this code:

  1. If this script is executed first, this code will correctly detect the fact that InputManager is scanning right now and we should not do anything.
  2. If the InputManager code is executed first, this code will fail to detect the fact of input scanning, because the InputManager cleared the IsScanning flag already, but GetButtonDown("Cancel") still returns true for this frame.

In general we have no idea in what order the scripts execute, and this behavior is not deterministic. I use the same button for a scan cancel and a back menu navigation, and I use the same code in two places: a title screen menu and a in-game menu. In the title screen scene it works like an example โ„–1, while in-game it works like an example โ„–2.
We can set the execution order manually in the Unity settings, but it's not a very good practice.

Input Editor changes dont take effect

Edit, sorry im just tired and do stupid things.
I forgot i was forcing it to reload from the xml file that stores the player customized data oopsie

No option for joystick buttons.

When choosing an analog button to build a config with a controller, the analog button shows the axis, none of which are listed anywhere for corresponding to y, b, x and a keys for example.

InputAdapter causes error after starting.

When using the InputAdapter, you'll get the following error message after starting your game:

The input configuration named 'Desktop' is already being used by a player
UnityEngine.Debug:LogErrorFormat(String, Object[])
TeamUtility.IO.InputManager:SetInputConfiguration(String, PlayerID) (at Assets/InputManager/Source/Runtime/InputManager.cs:638)
TeamUtility.IO.InputAdapter:SetInputDevice(InputDevice) (at Assets/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs:597)
TeamUtility.IO.InputAdapter:Awake() (at Assets/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs:445)

(The name of obviously varies, depending on your project setup.)

As a workaround, you can configure your InputManager to use one of the joysticks by default.
It's not a big issue, but I'm reporting it nonetheless. You shouldn't have to rely on such workarounds.

Xbox Controller buttons not registering, but analog axes are?

Hey there, I've been using InputManager for quite a while now and have never had much of a problem with it, I recently updated the plugin in my Unity project and have attempted to set up controller support for our game.

It's mostly going okay, I've got the analog sticks and triggers working fine, but none of the buttons or bumpers are working. No errors, just the Axes do not return a value.
I'm not really sure what I could be doing wrong, as I suspect that it's me rather than an issue with the code. I've tried numerous input configurations (almost everything I could think of), all based off the default files.

Any ideas? I can give you a copy of the project if you wish.

Also, while I'm here - I've got a small issue with the InputAdapter where it breaks on initialisation if the gameobject is enabled straight away - a workaround is to enable it a second after the scene has loaded but this seems a bit hacky. It throws the following:
NullReferenceException: Object reference not set to an instance of an object TeamUtility.IO.InputMgr.SetInputConfiguration (System.String name, PlayerID playerID) (at Assets/Scripts/Utils/InputManager/Source/Runtime/InputManager.cs:639) TeamUtility.IO.InputAdapter.SetInputDevice (InputDevice inpuDevice) (at Assets/Scripts/Utils/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs:597) TeamUtility.IO.InputAdapter.Awake () (at Assets/Scripts/Utils/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs:445)

InputManager export fail

Attempting to export an InputManager.asset file that uses input characters "[" and "]" fails.

If these are replaced with other characters, the issue is resolved.
Enclosed are sample .asset files that demonstrate the issue.
Stack crawl from failure also enclosed.

InputManagerAssetFail.zip

XBox Controller Support

I have tried to set up an XBox controller. And it seems that most axis except for X, Y and the 3rd does not work.

And if possible it would be nice if all axis maps to the standard like here: Link

How to disable Keyboard Input

I'm sorry if this has already been answered - I did look through the wiki multiple times, but couldn't find any notes about this.

So, I have an Input Manager with KeyBoard, Windows+Mac+Linux gamepad; I also have an Input Adapter where I have set windows gamepad only for player1.

When unity starts, I get a log message that Keyboard+mouse is being used; now it does switch to joystick if I use it, and then jumps back to keyboard the moment I move the mouse.

So, question is: can I completely disable this switch and have it stick to joystick.

PS: I did try unchecking realtime device hoping that as I have joystick setup, it will stick to that; instead it sticks to keyboard instead.

Thanks in advance.

Xbox Controller Axis Rounding

When I use the GetAxis method to get the direction the thumbstick or other axis is pointing, it seems to round around 0, 1 and -1. This is also present in the FPS example, you can see it if you in the scene view look straight down into the map and try to walk I circles, you will see that it moves in straight lines 50% of the time.

"Unable to parse YAML file" when opening project

After adding the InputManager every time I open any project an error is displayed in console several times:

Unable to parse YAML file: [mapping values are not allowed in this context] at line 1
Unable to parse YAML file: [mapping values are not allowed in this context] at line 1
Unable to parse YAML file: [mapping values are not allowed in this context] at line 1
Unable to parse YAML file: [mapping values are not allowed in this context] at line 1

I tried creating a new project, erasing the appdata's folder, even uninstalling / installing Unity. But the problem is still there.

Mouse X,Y Support

I'm unable to make Mouse X and/or Y to work under InputAdapter.GetAxis("Mouse X").
capture

Could you please direct me to the solution of this issue?
Thank you.

:Solved: Sensitivity should be at least 0.1 instead of 0

multiplayer input

doesn't appear to work with the unity 5.1 input :(
wish I had more time to explain and possibly help with
this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.