Search Unity

InControl - input and cross platform controller support for Unity, made easy!

Discussion in 'Assets and Asset Store' started by pbhogan, Jul 18, 2014.

  1. yakm

    yakm

    Joined:
    Sep 12, 2014
    Posts:
    24
    Hi i am running into a bug where i am trying to track the input of the left analog stick, pressing up/down/left/right. When i press in any direction it calls the other directions though.. see attached image. I set this up in an empty project only with inControl imported. Press any direction 1 time and it will log the other presses.

    EDIT: Tried it out using a different setup and i get the same results. see test.cs

    EDIT: This is intended behavior, here is their response to anyone else running into this problem in the future.

    This is actually correct behavior. WasPressed fires on the frame that the control changes state to true (that is, its value is > 0.0f), and for analog sticks, this is going to fluctuate when you're near any of the axes. For example, moving the stick even slightly right will fire Right.WasPressed as soon as it is > 0 and then probably fire Up or Down as well since it's really hard to move the stick without moving the Y axis slightly too, and it might then fire up/down a few times as you wiggle across the Y axis a few times while moving right.

    To get around that sensitivity you need to tell InControl that you want a different definition for what the true state is for these analogs. You can do that with the StateThreshold property:
    pa.Left.StateThreshold = 0.5f;
    pa.Right.StateThreshold = 0.5f;
    pa.Down.StateThreshold = 0.5f;
    pa.Up.StateThreshold = 0.5f;

    If you have a combined TwoAxisPlayerAction you can set it on that too.

    All the best,
    Patrick
     

    Attached Files:

    Last edited: Feb 25, 2016
  2. artem-sv30

    artem-sv30

    Joined:
    Feb 25, 2016
    Posts:
    1
    There has a been a post #139 stating about DPad issues with Xbox One gamepad for Win10. There were a solution #141 below, and your (pbhogan) promise #144 that you will fix that. In the source code of InControl I have, I can see differences between X360 and X1 mappings for DPAD. But it seems like Microsoft in their hand also changed mappings for DPad buttons of X1 gamepad's drivers!

    So I had to make equal DPad mappings for X360 and X1 gamepads (Xbox360WinProfile.cs and XboxOneWin10Profile.cs respectively). Just FYI.

    Best regards, Artem.
     
  3. beit

    beit

    Joined:
    Mar 5, 2015
    Posts:
    24
    Hey Gallant Games, we are interested in buying your solution but we see a drop on response on the forum and we are scared you are dropping the dev/support for this plugin. Is this the case?
    Thanks a lot :D

    Best,
    Enrico
     
    rocket5tim likes this.
  4. nyonge

    nyonge

    Joined:
    Jul 11, 2013
    Posts:
    20
    Hi @pbhogan! Loving InControl so far, it's fully implemented with no bugs, keyboard and gamepad.

    However we're having maaaajor performance issues, InControl seems to be having a huge effect on framerate and is causing GC.Collect to be called every frame. Attached pic shows the performance hit, and what happens when InControl gets disabled. (blue is InControl, orangey-green is incontrol causing GC.Collect to be called).

    I only have two entities using InControl active at a time, it's a co-op game. All the InControl calls are from within MovableEntity.Update().

    Why's this happening, and is there anything I can do about it? Thanks!

     
  5. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    It's still very much actively in development, but as I've said a few times on this thread, I find the forum really clunky and buggy in sending me notifications and I just don't check it very often. I'm usually very responsive by e-mail (or Twitter for short questions).

    Honestly, I kind of wish I could freeze this thread and just have a note at the end that says "E-mail me for support." :confused:
     
  6. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Thanks for the heads up! I'll check it and make sure the right mapping is in the next update.

    The next update should also bring the long-awaited native module beta for Windows and Mac which talks directly to XInput/DirectInput to be less buggy and more efficient.
     
  7. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    I should also point out that if it seems like I didn't answer someone in the thread it's usually because they also reached out to me by other means (e-mail, twitter).

    If I somehow missed you, please get in touch.
     
    nyonge likes this.
  8. nyonge

    nyonge

    Joined:
    Jul 11, 2013
    Posts:
    20
    My issue's resolved, bug on my end that ended up with me adding InputManager.OnDeviceAttached/Detached listener every frame! Tho Gallant Games was super helpful on twitter in figuring out the issue
     
  9. InfinityCoder88

    InfinityCoder88

    Joined:
    Oct 4, 2013
    Posts:
    243
    Hi @pbhogan ,

    Will InControl support MOGA HERO POWER for Android?
     
  10. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Possibly, although you can add support yourself.

    Unfortunately adding support for controllers involves actually having them physically present to create and test the mappings. You can create the profile yourself if you like. It’s not very hard but takes a little bit of manual trial and error.

    First, you’ll want to fire up the TestInputManager scene on device (or run it in the Unity editor for desktop systems). The controller should come up as an unknown controller if InControl doesn’t support it and will list a bunch of analogs and buttons. Fiddling with the controls will show you which inputs respond as which buttons and analogs.

    Then copy one of the profiles in InControl/Source/Unity/DeviceProfiles and adjust it accordingly. Other than the button/analog mappings, you have to make sure the supported platforms property has the right string in it and the joystick names property should have the name as it appears to Unity in GetJoystickNames(). This also shows up in TestInputManager.

    If you have a full working profile, you are welcome to send it to me for official inclusion in the package.
     
  11. Un4GivN_X

    Un4GivN_X

    Joined:
    Aug 6, 2014
    Posts:
    5
    Hi! I just implemented uGui navigation like this: http://www.gallantgames.com/pages/incontrol-new-unity-gui

    My actual problem is that any joystick connected can all manipulate the UI at the same time. I would like to select one "master" input and block all other input. I can't find anything on this matter.

    Thank you
     
  12. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    There's actually a Device property in InControlInputModule.cs, but it's currently not public (I'll look at making it public for the next update) but if you modify it to be public you can set a device that way. The other way is if you have PlayerActions assigned to MoveAction, SubmitAction and CancelAction, you can assign to the Device property of their owning PlayerActionSet to specify a device.
     
  13. Un4GivN_X

    Un4GivN_X

    Joined:
    Aug 6, 2014
    Posts:
    5
    We're having a lot of issues with the keyboard support. Since it doesn't have a valid InputDevice object, all our implementation feels like hacking the game with exceptions. It would be really nice to handle the keyboard exactly the same way as any controller.

    I want to set keyboard as the main Device in InControlInputModule. If I set null (keyboard inputDevice is null) then it crash at runtime.
     
  14. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    It becomes a lot easier if you're using the bindings API (PlayerActionSet).

    I understand your issue, though. I've considered it a few times already, but it would be a large architectural change that would break a lot of people's existing code and thus discourage them from upgrading. I might adopt that approach for a major update like 2.0 where it's clearly going to be very different.

    Another approach you can take is to create your own virtual device that internally gets input from the keyboard through Unity's methods. Then it'll appear like any other device.
     
  15. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    575
    Hey @pbhogan !
    I'm using InControl in a current project and want to simulate button presses in order to test movement in a (more or less) deterministic way. Sadly I wasn't able to figure out how to do this. My approach:
    Code (CSharp):
    1.             public InputControlType InputAction;
    2.  
    3.             public override void TriggerInput()
    4.             {
    5.                 Debug.Log("Pressing button " + InputAction);
    6.                 InputManager.ActiveDevice.GetControl(InputAction).
    7.                     UpdateWithState(true, InputManager.ActiveDevice.LastChangeTick, Time.fixedDeltaTime);
    8.             }
    I do get the debug message, but the InputAction (e.g. Action1) is not triggered.

    €dit: I just thought about it again... I will try to create a virtual device instead, that's probably a viable way. Or did I miss some awesome functionality? :)
     
    Last edited: Jun 6, 2016
  16. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Unfortunately, you can't force feed input into an existing device like that. You'll need to create a virtual device (see the virtual device example) and provide input when InControl asks for it during its update tick (by overriding the Update() method on InputDevice).
     
  17. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    575
    Thanks, I got to that though as well. This solution works rather well for me, my code for the virtual device looks like this:
    Code (CSharp):
    1. // --------------------------------------------------------------------------------------------------------------------
    2. // <copyright file="DebugDevice.cs" company="Supyrb">
    3. //  Copyright (c) 2016 Supyrb. All rights reserved.
    4. // </copyright>
    5. // <author>
    6. //  Johannes Deml
    7. //  send@johannesdeml.com
    8. // </author>
    9. // --------------------------------------------------------------------------------------------------------------------
    10.  
    11. namespace Supyrb.Marbloid.Input
    12. {
    13.   using System.Collections.Generic;
    14.   using InControl;
    15.  
    16.   public class DebugDevice : InputDevice
    17.   {
    18.   private Dictionary<InputControlType, float> currentInput;
    19.   private bool isDirty;
    20.  
    21.   public DebugDevice()
    22.        : base( "Debug Controller" )
    23.   {
    24.   // Add the controls that are emulated
    25.   AddControl(InputControlType.LeftStickLeft, "Left Stick Debug");
    26.   AddControl(InputControlType.LeftStickRight, "Left Stick Right");
    27.   AddControl(InputControlType.LeftStickUp, "Left Stick Up");
    28.   AddControl(InputControlType.LeftStickDown, "Left Stick Down");
    29.   AddControl(InputControlType.LeftBumper, "Left Bumper");
    30.   AddControl(InputControlType.RightBumper, "Right Bumper");
    31.   AddControl(InputControlType.Action1, "A");
    32.   AddControl(InputControlType.Action2, "B");
    33.   AddControl(InputControlType.Action3, "X");
    34.   AddControl(InputControlType.Action4, "Y");
    35.  
    36.   currentInput = new Dictionary<InputControlType, float>();
    37.   isDirty = false;
    38.   }
    39.  
    40.  
    41.   // This method will be called by the input manager every update tick.
    42.   public override void Update(ulong updateTick, float deltaTime)
    43.   {
    44.   if (currentInput.Count == 0 && !isDirty)
    45.   {
    46.   Commit(updateTick, deltaTime);
    47.   return;
    48.   }
    49.  
    50.   isDirty = false;
    51.   for (int i = 0; i < Controls.Length; i++)
    52.   {
    53.   if (Controls[i] == null)
    54.   {
    55.   continue;
    56.   }
    57.  
    58.   if (currentInput.ContainsKey(Controls[i].Target))
    59.   {
    60.   if (Controls[i].IsButton)
    61.   {
    62.   UpdateWithState(Controls[i].Target, true, updateTick, deltaTime);
    63.   }
    64.   else
    65.   {
    66.   UpdateWithValue(Controls[i].Target, currentInput[Controls[i].Target], updateTick, deltaTime);
    67.   }
    68.   isDirty = true;
    69.   }
    70.   else
    71.   {
    72.   Controls[i].ClearInputState();
    73.   }
    74.   }
    75.   currentInput.Clear();
    76.  
    77.   // Commit the current state of all controls.
    78.   // This may only be done once per update tick. Updates submissions (like those above)
    79.   // can be done multiple times per tick (for example, to aggregate multiple sources)
    80.   // but must be followed by a single commit to submit the final value to the control.
    81.   Commit(updateTick, deltaTime);
    82.   }
    83.  
    84.   public void SetInput(InputControlType type, float value)
    85.   {
    86.   currentInput[type] = value;
    87.   }
    88.  
    89.   public void Reset()
    90.   {
    91.   for (int i = 0; i < Controls.Length; i++)
    92.   {
    93.   if (Controls[i] == null)
    94.   {
    95.   continue;
    96.   }
    97.   Controls[i].ClearInputState();
    98.   }
    99.   currentInput.Clear();
    100.   isDirty = false;
    101.   }
    102.   }
    103. }
     
    Last edited: Jun 6, 2016
  18. Baznor

    Baznor

    Joined:
    Apr 29, 2013
    Posts:
    6
    I'm having issues using NativeInput on Windows with the latest release of InControl.
    The native .dll is causing unity to crash if you try debug the editor.
    Also getting an error on some windows machines: 'InControlNative.dll' specified module could not be found.
    Works great on OSX but.
    I know its only in beta so happy to disable it for now, but would be great to get it working.
     
  19. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I quit developing for a couple months, and just tried the new version in a fresh project, and after updating InControl my game it is not recognizing my ps4 controller. in play mode?

    I have a manager script on the object in scene, so I can't figure out why it won't work, or show my controller in the console like it used to, on startup when I run my scene.
     
  20. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Can you give me some more information? What version of Unity? What is the machine it's not working on running?

    Feel free to e-mail me with more specifics.
     
  21. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Does the TestInputManager scene work?

    Have you tried restarting Unity after your controller was connected? This is often an issue in Unity 5, particularly on Mac.
     
  22. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    It works now, thanks.

    And let me say this is still my favorite controller solution!!!;)
     
  23. Baznor

    Baznor

    Joined:
    Apr 29, 2013
    Posts:
    6
    Unity 5.3.5f1 + 5.3.5p5 crashed on Windows 64bit PC when debugging if NativeInput enabled.
    InControlNative.dll doesn't load on Intel i5-2500K Windows7 64bit, loads fine on Intel i7-2420HQ Windows10 64bit.
     
  24. nyonge

    nyonge

    Joined:
    Jul 11, 2013
    Posts:
    20
    @pbhogan can confirm this issue is still kicking around, this was found on a Win10 64-bit machine. If it helps, the build was made off of a Mac, for windows.

    http://i.imgur.com/FbzKoj3.jpg (ignore the non-error debug output, it looks like it's looking for the wrong filename, looking for .dll twice? .dll.dll)
     
  25. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    230
    AFAIR the double .dll is just an log output thing from InControl, it looks for the correct file name (as seen in the first two lines). I would first make sure the DLL is actually in that place and if it is it's most likely missing a dependency. You can check dependency with a tool like Dependency Walker, it will tell you what DLLs are required and if any of them can not be found.
     
  26. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    As mentioned by @Alloc, it is most likely a dependency issue, usually some form of XInput is missing. I primarily develop/test the native module on Windows 10 64-bit, and I thought it had all the dependencies by default. I'd expect that issue with maybe Windows 7 or 8. Is it happening with the latest build?
     
  27. nyonge

    nyonge

    Joined:
    Jul 11, 2013
    Posts:
    20
    @pbhogan If you mean latest build of InControl, yup! I think it's the latest version of Unity as well. If it affects it at all, the build was produced on a Mac with the latest OS X. I've had a few playtesters on Windows though and this is the first time this particular error has shown up.

    Thanks for the reply, let me know if you want any other info – I can bug the guy who found this bug if you want anything from his system, in the meantime I'll try pointing him towards Dependency Walker (thanks @Alloc !)
     
  28. Vegetables

    Vegetables

    Joined:
    Aug 15, 2016
    Posts:
    10
    I noticed in your Changelog (1.6.1) InControl uses controllers from 360Controller on OSX which according to this page is licensed under the GNU General Public License. From my understanding of the license, it means that anything I make with InControl would also automatically become subject to this license and I would have to give out my source code free to anyone who asked for it. Is this true? Info: Can I use GPL software in a commercial application?
     
  29. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    230
    But InControl doesn't incorporate 360Controller, it only talks to it. So InControl doesn't have to be GPL and thus your code doesn't have to either :)
    (If at all it loads a library of 360C and this would be a grey area of the GPL, but only Patrick knows how exactly he interacts with that thing)
     
  30. Vegetables

    Vegetables

    Joined:
    Aug 15, 2016
    Posts:
    10
    Thanks for the response! Correct me if I'm wrong, but aren't the controller profiles in InControl/Source/Native/DeviceProfiles/Generated/ from 360Controller? I guess if I remove these I would be okay.
     
    Last edited: Aug 15, 2016
  31. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    @Vegetables No, nothing in InControl is source from 360Controller. Those profiles are custom generated for InControl (assisted by a tool that I wrote) that lets InControl identify them properly. Basically, it just lets me know if there are any not yet supported and has me fill out their info after some Googling before generating profiles.

    There are no licensing issues. :)
     
  32. Vegetables

    Vegetables

    Joined:
    Aug 15, 2016
    Posts:
    10
    Thanks for clearing that up!
     
  33. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    379
    Hi! I'm new to InControl and having some trouble setting up the sticks on my Neo-Geo USB controller.
    How can I invert one of the axis? The Y axis reads upside down. Everything works just fine otherwise.

    Another question: How do you cope with multiple devices sharing a USB ID? I noticed that the GameCube profile clashes with my Sega Saturn controller. For now I've just removed the GameCube profile but this isn't a nice solution.
     
  34. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    There is an Invert property you can use in profile mappings. You may need to expand the shortcut methods like LeftStickUpMapping() to the full code it contains. Alternatively, you might be able to use LeftStickUpMapping2() and LeftStickDownMapping2() which have the Y inverted.

    With Unity profiles there is nothing you can do on conflicting names since that is all Unity provides to identify devices. For native input profiles you should be able to use different Vendor ID and Product ID to distinguish between the two devices. Those are under InControl/Source/Native/DeviceProfiles.
     
  35. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    230
    @nyonge @pbhogan
    I suppose it's the VC2015 runtime (MSVCP140.dll and VCRUNTIME140.dll) that's missing. One of our testers has that issue too. As I think the 2015 runtime isn't that common I wonder whether it would be easy to switch to the 2010 runtime as basically any program / game has installed that for years anyway by now ;)
     
  36. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    I'll take a look and see if that's possible. I'm not super familiar with configuring Visual Studio... I've been more of a Mac/iOS development guy for a while. :)
     
  37. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    @nyonge @Alloc Okay, so it turns out while I could crank it down to the 2013 runtime, I would need to get VS 2010 installed to switch it to the 2010 runtime but a) I don't have it, and b) it apparently doesn't install on Windows 10 without shenanigans.

    However, I can statically link the runtime toolset into the DLL so in theory it won't require particular versions of the MSVCP and VCRUNTIME DLLs. It doesn't even seem to bump up the DLL size much of anything probably because I use almost nothing of it. The only problem is, I have no way of testing if this works. :) If anyone has a particular tester they could throw this at, please hit me up at my e-mail and I'll give you the build.
     
  38. IDreamofIndie

    IDreamofIndie

    Joined:
    Dec 24, 2014
    Posts:
    37
    Hello,
    I am trying to get the Touch Control knob to be fixed to the knob range.
    Here is a picture of the control stick I am using to get a better idea what I am trying to achieve.
    I want the knob to stay in the black area of the ring.

    This is what I had which worked, but only if the Touch Control is at the exact position I had it at .
    I would like it to do this with the snap to initial touch and dragging on.
    Code (CSharp):
    1. if (clampKnob == true) {
    2.                 var clamppos = KnobPosition;
    3.                 float distance = .6f;
    4.                 clamppos.y = Mathf.Clamp (KnobPosition.y, -4.1f, -3.5f);
    5.                 KnobPosition = (clamppos - RingPosition).normalized * distance + RingPosition;
    6.                 //Debug.Log (KnobPosition);
    7.             }
    clampKnob is just a bool so I can toggle this feature on and off.

    Any help would be appreciated.
    Thanks
     
    Last edited: Sep 1, 2016
  39. IDreamofIndie

    IDreamofIndie

    Joined:
    Dec 24, 2014
    Posts:
    37
    So I got it working with this:
    Code (CSharp):
    1. if (clampKnob == true) {
    2.                 movedPosition = beganPosition + (Mathf.Clamp (length, worldKnobRange, worldKnobRange) * normal);
    3.             }
    4.             else{
    5.                 movedPosition = beganPosition + (Mathf.Clamp( length, 0.0f, worldKnobRange ) * normal);
    6.             }
    But I need to go with something else because it doesn't work as expected.
    I am trying to get it so The X input Axis (-1,1) controls 180 degrees of rotation.
    Where -1 = 270, 0 equals 180, and 1 equals 90.
    In my movement script I have
    Code (CSharp):
    1. // Use last device which provided input.
    2.         var inputDevice = InputManager.ActiveDevice;
    3.  
    4.         var x = inputDevice.LeftStick.X;
    5.         var y = inputDevice.LeftStick.Y;
    6.         y = Mathf.Clamp (y, -1f, 0f);
    7.  
    8.         //Making Players Rotation Lerp to match Current Direction of the Joystick
    9.         if (x != 0.0 || y != 0.0)
    10.         {
    11.             angle = Mathf.Atan2 (y, x) * Mathf.Rad2Deg;
    12.             newangle = Quaternion.AngleAxis (270.0f - angle, Vector3.forward);
    13.             newangle = Quaternion.Inverse (newangle);
    14.             player.transform.rotation = Quaternion.Lerp(player.transform.rotation, newangle,  rotSpeed);
    15.         }
    But this is using both input axis.
    I need it to only be with the Horizontal Input Axis
    Anyone know how i could accomplish this?
    Thanks
     
  40. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Hey, I have a much simpler solution, but it requires the latest work-in-progress package that contains some refactoring and fixes in that control. Please e-mail me if you'd like me to send you the package: http://www.gallantgames.com/contact
     
  41. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,442
    I've used InControl for quite a while now and it always worked fine for Unity Webplayer and desktop builds.

    However, I notice that in my WebGL builds the controller doesn't work. Same exact code and controller of course. Build for desktop works fine. Build for Webplayer works fine. Build for WebGL does not work at all.

    Am I missing something?
     
  42. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Unfortunately, WebGL is not supported at this time. Gamepad support in browsers is very finicky, and not all browsers support it consistently. Mappings are different per browser, per OS and possibly per browser version—that is if it works at all. Last time I checked it was pretty flakey. I have it on the to-do list to look at adding maybe just a couple major controllers, but even then the permutations are crazy so it's not guaranteed to work on all systems.

    My honest opinion is don't make WebGL games that need gamepad support in any serious capacity. If I add any support at all, it would only be recommended for something like game jam purposes or tightly controlled environments or you're going to have a lot of angry users.
     
    GarBenjamin likes this.
  43. DanFlanaganCodes

    DanFlanaganCodes

    Joined:
    Jun 21, 2014
    Posts:
    17
    Hey great package I am using a PS4 controller on my PC. @pbhogan I was wondering how I would access the PS4 Pad pressed with your package. Not the D Pad, the new feature on the controller.
     
  44. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    This should do the trick:
    inputDevice.GetControl( InputControlType.TouchPadTap );

    Note: it's not necessarily supported on all platforms (but I believe it works on Window and Mac) and only the button is available. Actual touch position / track pad type input is not supported as it seems to be a console specific feature and doesn't report on other systems.

    Also, it may get renamed to InputControlType.TouchPadButton at some point to be more consistent with Sony's naming guidelines, so if you see an error about that or it stops working you may need to switch it after a future update.
     
  45. IDreamofIndie

    IDreamofIndie

    Joined:
    Dec 24, 2014
    Posts:
    37
    Hello,
    I have been trying to change the dragging of the Touch control stick to be limited to just horizontal axis without success. Even if you lock the axis to horizontally only, you can still drag the Touch control stick vertically. Could you change/add the allow dragging checkbox to be two checkboxes: allow horizontal dragging and allow vertical dragging?
    I feel this could be useful for when you lock the movement axis to horizontal or vertical.
    Thank You for your consideration.
     
  46. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Sure, I'll put it on the to-do list. :)
     
  47. StanislavL

    StanislavL

    Joined:
    Sep 22, 2016
    Posts:
    3
    Hello. Tell me is it possible to make the switching between the keyboard and gamepad to call OnActiveDeviceChanged event? I need to hide some of the buttons, if enabled gamepad and show if there was input from the keyboard.
     
  48. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    No. As the result of a historical quirk, Device in InControl means "controller". Keyboard/Mouse are treated separately. The way to detect changes is through the PlayerActionSet.LastInputType and PlayerAction.LastInputType properties.

    As of 1.6.4, PlayerActionSet and PlayerAction also have OnLastInputTypeChanged events.
     
  49. yakm

    yakm

    Joined:
    Sep 12, 2014
    Posts:
    24
    Hello,

    // you need to install the Gamepad plugin from Unity Native Plugins for Xbox One.

    Where can i find and download the Gamepad plugin?
     
  50. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    219
    Unity Xbox Forums
    Build Downloads (Sticky Topic)
    Latest Builds
    Unity's Xbox One Native Plugins

    Gamepad.dll can be found in Binaries\Native\Variations\Durango_Release