Search Unity

[Released] cInput 2 - Unitys custom inputmanager got improved !

Discussion in 'Assets and Asset Store' started by Roidz99, Apr 4, 2012.

  1. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    We don't think there is a easy direct way to check. But there is a way ofcourse - you could check all inputs for mouse strings in their name. This will require some string manipulation but it can be done that way i think. If you don't know how to do this i can take a look at it i gues.
     
    Last edited: Jun 15, 2013
  2. SullyTheStrange

    SullyTheStrange

    Joined:
    May 17, 2013
    Posts:
    147
    EDIT 3: I added a cInput.Clear(); at the top of the Awake() function and that seems to have fixed it... All controls are now working perfectly, primary and alt. Is that normal?

    Hey guys,

    I just bought cInput 2.0 and I hit a roadblock. Basically, it seems like the SetKey lines aren't working most of the time... Once in a while a few of the inputs will work, but only sometimes, and never all of them. Obviously I think I'm just missing something obvious, but I don't know what. :(

    I SHOULD have everything set up right... the SetKey lines are in the Start function and they aren't setting anything weird -- cInput.SetKey("Right", "D", "RightArrow"); -- just like that. But in a Debug.Log line I'm checking for cInput.GetKey("Right") and the other controls and it ignores me. It looks like whenever I switch scenes and then come back, some of the inputs (still not all) work on the first preview, but never again. After that they're all printing out False no matter what I do.

    I followed the set-up guide and replaces the InputManager.asset file... What am I doing wrong?

    EDIT: I should also say, I'm using Unity 4.1.5.

    EDIT 2: It occurred to me that the SetKey code might HAVE to be in a separate script (before I had it in the Start function of my main player script) so I tried that, and now... well, it kinda improved. :p Two of the four controls work perfectly every time, but the other two never do. And none of the alt controls do.
     
    Last edited: Jun 19, 2013
  3. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    I don't think this is normal behavior. It sounds like a bug that I was pretty sure I fixed recently. . . I'll look into it. Thanks.
     
  4. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    a long overdue update has been posted to the website and the asset store. Deozaan will give the details soon !
    PS the callibration bug is not fixed yet. We are working hard on a fix.
     
  5. usegobos

    usegobos

    Joined:
    Jan 26, 2013
    Posts:
    2
    I am currently running into an issue using Unity Serializer alongside cInput2 such that when I load saved games, I get multiple copies of cObject and the associated scripts. I have also seen this during scene transitions. Is this something that I should actively try and prevent on my end?

    Thanks
     
  6. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    Hi folks,

    An update to cInput has been submitted to the Asset Store and the cInput website. If you bought cInput from the Asset Store then the update should be available within about 24 (business) hours. If you bought it from the website then the update is available right now.

    cInput changes:

    v2.5.4

    • Fixed GetAxisRaw almost always returning 0 when using gamepad and mouse axis. (Thanks V4nKw15h)
    • Fixed ChangeKey not setting modifiers properly. (Thanks Krileon)
    • Fixed secondary inputs not accepting modifiers. (Thanks hjupter)
     
  7. Cyberdogs7

    Cyberdogs7

    Joined:
    Mar 26, 2012
    Posts:
    25
    Hey, I just tried updating to 2.5.4 from (I believe) 2.5.2 and it was really broken for me.

    I had inputs that would stop working, key bindings didn't seem to be maintained and it was just generally really broken.

    I don't think I had anything special going on, since 2.5.2 work perfect and I am not really using any of the newer features, like modifier keys.

    I reverted back to 2.5.2 but wanted to give you the heads up.
     
  8. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Does it support the analog triggers on a ps3 controller in osx? couldn't find the axis.
     
    Last edited: Jul 13, 2013
  9. Laztor

    Laztor

    Joined:
    Nov 10, 2012
    Posts:
    3
    I noticed that when you bind a set of keyboard keys and a set of controller axis to the same cInput axis, using the keys will eventually return 0f. Known bug?

    Looks like the way the axis gets compiled differs when you put both keyboard keys and the controller on the same axis, the axis no longer recognizes that the key has been released (it always registers as that axis being true), while the input does recognize it.
     
    Last edited: Jul 14, 2013
  10. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Is there any way to increase this limit if it's still in effect? My game currently supports a near-arbitrary number of local players (up to what seems to be Unity's joy num limit of 11). If it were possible to assign an arbitrary number of players (16, for example, which is above Unity's built-in limit) by simply looping from 1 to 16 and setting keys such as "[P" + i + "] Thrusters," I would be very interested in cInput. However, if five gamepads is the hard limit, this may very well be a deal breaker for me. As far as I know, DirectInput supports an unlimited number of devices, and that's something I'd like to see in Unity. That being said, because Unity also uses joystick keycodes up to 5, I'm wondering what it does to support joy nums up to 11 and how it handles DirectInput and XInput.

    Any information regarding if and how cInput and unity's input manager handles more than five gamepads would be appreciated.
     
  11. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    As you mentioned unity only supports keycodes for up to 5 joystics... because of this we are not able to support more.
    We think this is just a soft limit in unity... if they extend their api to support more joystics, so will we, untill then there is little we can do. Sorry
     
  12. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Normally the rule is... if unity can find it, cinput can find it. We take care of keybinds etc but we don't make new drivers.
    Make sure you can access all axis in osx/unity - then cInput will also.
     
  13. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Thanks for letting us know... we are unsure what went wrong and are looking for a fix. Thanks for the headsup
     
  14. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Deozaan noticed me about this bug... i haven't looked into this yet but i know he is on it. We hope to get a fix for this asap.
    If you need a older version so you can keep working with cInput send us a email and we will hook you up...
     
  15. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I already sent a mail to Ward, but got no answer, so I try it here:

    ---

    I just bought cInput 2 and already got a problem with it. I just can't get the mouse axes behave like Unity's normal InputManager, and I wonder if I'm doing something wrong.

    I setup the mouse like this:

    cInput.SetKey("Look Left", Keys.MouseLeft);
    cInput.SetKey("Look Right", Keys.MouseRight);
    cInput.SetKey("Look Up", Keys.MouseUp);
    cInput.SetKey("Look Down", Keys.MouseDown);
    cInput.SetAxis("Look X", "Look Left", "Look Right", 0.1f, 0.0f);
    cInput.SetAxis("Look Y", "Look Down", "Look Up", 0.1f, 0.0f);

    Gravity and sensitivity are the same values as the InputManager uses them for the mouse axes.

    So, now when I use e.g. cInput.GetAxis("Look X") instead of Input.GetAxis("Mouse X"), movement is jerky, especially when I do fast mouse movement.

    I went so far to compare the values of cInput.GetAxis() and Input.GetAxis() for the mouse axes, and the values are always different, like so (I picked some random values from my log for demonstration purposes):

    cInput: -0.2 Input: -0.05
    cInput: -0.1 Input: 0
    cInput: 0.7 Input: 0.45
    cInput: 0.9 Input: 0.65

    I guess I made some error setting the mouse axes, but information regarding this is surprisingly sparse. So could you please help me?

    ---

    Also, I encountered some errors when trying to change a key using ChangeKey() via my own GUI in combination with a modifier (LeftAlt). The modifier gets somehow recognized, but the setting gets lost or so. (As this is the Alt key, I know it doesn't work always in the editor. But also it also doesn't work in the standalone.) [edit]I can't even use any modifier in the provided demo of cInput.[/edit]
     
    Last edited: Jul 20, 2013
  16. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I noticed mouse movement through cInput felt awful. Felt delayed and clamped.
     
  17. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    Sorry for the delayed response. Ward and I had been talking about your e-mail and were trying to figure out the problem. I'm not sure why the mouse axis input differs so widely from Unity's built-in mouse input. I'll have to run some tests of my own and see if I can figure out why it's doing this. Thanks for your thorough report.

    As for using ChangeKey(), I'm not sure I understand what you mean when you say the modifier gets recognized but the setting gets lost. And when you say modifiers don't work in the provided demo, are you talking about the webplayer demo on our website? Or the one in the included project? For modifiers to work in the included project, you'd need to add a few lines of code to specify which keys to use as modifiers with AddModifier().
     
  18. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Of course I use AddModifier(). Yet the modifiers won't get saved.
    Even when I start the demo from the included project, the modifiers I try to use just don't show up - even though the "Shoot" control uses LeftShift+X per default.
     
    Last edited: Jul 21, 2013
  19. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    I see what you're saying now. And I'm able to duplicate the issue. To be honest, I'm not really sure why this is happening. But we'll look into a fix.
     
  20. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    How does cInput handle sensitivity and gravity when using digital keys/buttons as an axis? Are digital inputs always functionally raw, or is smoothing applied when using GetAxis?
     
  21. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    cInput will apply smoothing when using GetAxis even for digital inputs.
     
  22. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Cool, thanks.
     
  23. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Do you support GetAxisRaw? It's an essential method to support because if you pause your game with Time.timeScale, GetAxis will not return anything useful due to the built in smoothing, while GetAxisRaw will continue to receive user input - great for menus and the like when paused.
     
  24. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    Yes. cInput has a GetAxisRaw function.
     
  25. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    @Deozaan, thanks for your responses. When do you think will you have the two fixes (the mouse axes one and the modifiers one) ready?
     
  26. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    really like cInput, I'm noticing that cInput's GetAxisRaw seems to still have a deadzone on analog sticks, I'm trying to filter it through my own circular deadzone, but it likes to stick on the horizontal's and verticals (even without my own deadzone code).

    I noticed that the two joystick axis I'm using have 'dead' of 0.19 in the InputManager. Is this what is supposed to be set by cInput's InputManager? I tried lowering that and it changed the feel of the analog sticks, made them more sensitive and less sticky on the horizontal / vertical axis.

    *EDIT*

    I looked at it more this morning, what I've figured out is to best use your own deadzone code for an analog stick, you'll want to set the appropriate joystick axis in the InputManager to Dead 0, Gravity 0, and Sensitivity 0.5.

    For some reason, when I use the default 1.0 Sensitivity, it actually doubles my analog input so I end up with -2 to +2. So setting to 0.5 was very important... I'm testing on x360, ps3 and ouya controllers.

    so just Unity being a little confusing. cInput is helping tons with handling input across a variety of controllers!
     
    Last edited: Jul 30, 2013
  27. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Hey Ratking.
    The modifiers bug will be fixed (according to others) really quick now we think. Sorry for the delay.

    About the mouse axis. I looked into this and indeed the cinput mouse axis return differend values then the standard input mouse axis. Let me explain why this is...

    if you move the mouse really quick then the standard unity mouse axis will show values that can go really high or really low.
    If you move the mouse really quick with cinput mouse axis then the values are clamped between -1 and +1. This explains why you get differend results.

    I know this can be anoying that you can't use the exact same code for cinput but this is how cinput works. Now you know this it might be easy to fix your looking code. You just have to realize that a mouse axis isn't the same as a joystick axis ofcourse so it won't behave the same, you need differend code for mouse axis code. a mouse axis will always revert back to zero if u stop moving, while a joystick axis will keep returning -1 if you hold the stick the left.

    If you have problems getting your looking to work how it should, please provide us with a small testscene and we will try to solve this for you using cinput mouse axis.

    If you got more questions please keep asking them.
     
  28. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Are keys localized? Or does this only work for us keyboard layouts?
     
  29. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    It will work for any keyboard.
    I'm personally using a AZERTY keyboard while Deozaan is using a QWERTY keyboard.

    If this is isn't what you mean then please let us know.
     
  30. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    Hi folks,

    An update to cInput has been submitted to the Asset Store and the cInput website. If you bought cInput from the Asset Store then the update should be available within about 24 (business) hours.

    cInput changes:

    v2.5.5
    • Added deadzone settings on a per-axis basis with SetAxisDeadzone().
    • Fixed ChangeKey not setting modifiers properly (for reals). (Thanks ratking)
    • Fixed mixing keyboard and joystick/mouse inputs on an axis being totally broken. (Thanks Laztor)
    • Fixed individual sensitivity and gravity not working properly.
     
  31. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    This is one of the neatest products on the Asset Store!
    I got a custom input manager in my game and setup with an NGUI menu in under 30 minutes!

    Great product. Now user's will easily be able to customise their joystick and input.
    I'm getting my OUYA soon, will let you know if it all works correctly on this too.
     
  32. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Hey Roidz99,

    thank you very much for the response and the fix!

    Out of interest, but why do you clamp the values for cInput then?

    I don't quite understand your comparison between mouse and joystick, because this doesn't have any meaning for how to handle the axes in code. If the two input methods were vastly different, Unity's InputManager would have problems with it too. But the normal Input class handles them just fine.

    So yeah, I probably will have to create different code for the different axes now. This is something you should mention on your site IMHO, because being able to replace Unity's Input class completely with cInput was one of the reasons I bought it, and now it's not even true, as I have to write additional code.

    Please don't think I hold a grudge, the plugin is still cool!

    Regards,
    ratking
     
  33. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    hey Ratkin, we clamp the mouse because cInput expects all axis to be betweeen -1 and +1.


    Well it is important for cInput because when mouse axis are allowed in cInput (default off), then cInput makes no difference between a mouse axis and a joystick axis.

    The normal input class handles mouse axis perfectly fine,but try using the same code to look around using the mouse, then using left and right arrows.
    If this gives the same result, please provide us with some example code and we will make sure cInput does the same.
     
  34. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Oh !
    Deozaan forgot to mention that Bytecommerce, the company that we used to sell the asset on our website went down.
    We tought this was temporary but its been over a week now and we have little faith them comming back.

    We allready are working hard to get a new/better solution for this that offers more ways to pay and gives us better support.
    We make sure that everyone that allready bought cInput trough bytecommerce will keep receiving updates and support ofcourse!

    If anyone who bought trough the website wants the new update then send us an email that includes the paypal adress you used to buy cInput and a approximately date when you bought cInput.
    We will then email you the latest email.

    As soon the new ecommerce is setup we will sent out free coupons to everyone who bought trough bytecommerce.
     
    Last edited: Aug 4, 2013
  35. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Okay, and why does cInput expects this? And why can't you make an exception for the mouse axes (like Unity's InputManager does)?

    [edit]I guess the big advantage of Unity's Input class is that you can define the same axis more than once, so you can give different input methods (mouse, joystick, keys) different Sensitivity, Dead and Gravity values.[/edit]
    So yes, it doesn't give the "same" result, but it gives a working result. With the mouse the player can look around faster, of course, but that is expected and wanted, and shouldn't really concern you, as the provider of an input manager. :)

    -------

    BTW, I noticed something strange, and I wonder if this is fixed with the new version (and if it's even a bug of cInput). I define axes like this:
    Code (csharp):
    1.  
    2.         cInput.SetKey("Forward", Keys.W, Keys.ArrowUp);
    3.         cInput.SetKey("Backward", Keys.S, Keys.ArrowDown);
    4.         cInput.SetKey("Strafe Left", Keys.A, Keys.ArrowLeft);
    5.         cInput.SetKey("Strafe Right", Keys.D, Keys.ArrowRight);
    6.        
    7.         cInput.SetKey("Look Up", Keys.None);
    8.         cInput.SetKey("Look Down", Keys.None);
    9.         cInput.SetKey("Look Left", Keys.None);
    10.         cInput.SetKey("Look Right", Keys.None);
    11.        
    12.         //
    13.        
    14.         cInput.SetAxis(nameVertical, "Backward", "Forward", 3.0f, 3.0f);
    15.         cInput.SetAxis(nameHorizontal, "Strafe Left", "Strafe Right", 3.0f, 3.0f);
    16.         cInput.SetAxis(nameLookY, "Look Down", "Look Up", 1.5f, 3.0f);
    17.         cInput.SetAxis(nameLookX, "Look Left", "Look Right", 1.5f, 3.0f);
    18.  
    Now the really strange problem is, whenever I keep the key pressed which was defined last (in this case "Look Right", in my game changed to another key), all the axes return much much lower values than they should, so everything input related seems to get very slow (movement and rotation). I don't know why that is. I swapped the lines of SetKey()s, and it's always the last key defined that behaves this way.

    Regards,
    Friedrich
     
    Last edited: Aug 4, 2013
  36. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    cInput expects this because this is normal behaviour in unity also, it is always a value between -1 and 1. This is therefore also expected in peoples control code allready.
    There is not an exception for the mouse axes because normally people don't use the mouse axis as a normal input axis (like moving the player around). In most cases the mouse is used to aim and isn't interchangable with other keys/inputs.

    But as i mentioned before, with just a little hack, you can use cInput to change the keys for looking around and when you detect the player entered the mouse axis to look around, then just use the unity mouse input. I'm happy to provide you with an example if you desire so.

    In the last update, we fixed quiet a few bugs that were introduced recently. If you can't wait for the asset store to update this (we expect it to go live today) then send us an email with yr invoice number (or paypal adres if you bought on the website) and we email you the most recent version.
     
    Last edited: Aug 5, 2013
  37. V4nKw15h

    V4nKw15h

    Joined:
    Dec 16, 2011
    Posts:
    47
    Just a quickie:

    One of my alpha testers requested the option to clear a configured key back to "None". For the life of me I couldn't find a way to make this happen.

    I tried using SetKey with KeyCode.None and "" but neither worked. Is there a way to do it, or a couple of lines of code I could add to make it happen?

    Ideally I intend to let them right click on a keyconfig button to clear it.
     
  38. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Did you try Keys.None rather than KeyCode.None?
     
  39. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    I see the ability for cablibration on the joysticks doesnt appear to be resolved in your update yet. If you manage to resolve this let me know I managed to get it working in my release but would prefer it fixed by the developers so I can use their newer released and features.
     
  40. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    isgheero. Can you please email us the solution you found because we are still working on that one.
     
  41. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    What OhiraKyou says should work i think but you will have to code that in yourself
     
  42. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    If you're using cInput's supplied GUI, then I believe it is built in so that if you press Escape while it is waiting for some input then it will clear the keybinding and set it to None. But if you want to do it via script (in response to a right-click, for example), then as others have said, setting it to Keys.None should do the trick.
     
  43. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    yeah I will post the differences between your code and mine to show what was changed in a few hours when I get off work.
     
  44. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I would rather like to not have to use hacks after all.

    Fact is, the way how cInput implements the mouse axes is broken. If I want to use the mouse axes in cInput right now, I get very jerky movement and wrong values, and I have to use a hack.

    This means you as the developer either should get rid of support of mouse axes in cInput completely and also mention this on your homepage and plugin description. Or you should try to copy the behaviour of Unity's Input class so your claim "Works in the same way as the Input class." really becomes true.

    Could you try writing to Unity regarding the update on the Asset Store? It's still not live there.

    Regards,
    ratking
     
  45. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    We got a reply from Unity saying cInput was rejected because it creates a new menu item, which is strange because it's been that way for the past few versions. So we're going to have to resubmit it. Sorry for the delay!

    They want us to nest the menu item under an existing menu item, but honestly I'm not sure where it fits. It doesn't belong under GameObject because it doesn't create a GameObject. It doesn't belong under Components because it doesn't create a component.

    I suppose we could put it in Edit->Project Settings so that it's with the Unity Input Manager, but that still doesn't quite seem to be the right place for a simple installation script. . .

    Does anybody have any suggestions on this?
     
  46. Roidz99

    Roidz99

    Joined:
    Jul 8, 2010
    Posts:
    198
    Please don't expect a mouse axis to not work as a joystick axis... if you allow mouse axis in cInput, it's normal that if a player selects a joystick to look around or a mouse axis to look around that you need seperate code to make them do the same.
    You won't be able to use the same code for mouse axis looking and joystick axis looking. Neither in cInput or in unity default.

    If i'm wrong, which is possible, please paste me some code.

    EDIT: Ratkin, Deozaan and me are still discussing this mather in fact: we will do more tests on the mouse behaviour. If you have some code that you know works with the unity inputmanager and not with cInput, can you forward this to us please. It's easier to reproduce your problem then to make it up ourself if we have some code to work with.
     
    Last edited: Aug 8, 2013
  47. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    Hi everyone,

    I've just sent out coupon codes to everyone who bought cInput from our website using ByteCommerce. ByteCommerce disappeared without warning, so we've started using FastSpring instead. So if you bought cInput using our website, check your mailbox for a code and instructions on how to redeem the code to get cInput for free on FastSpring.

    If you didn't get a code and you should have, please check your spam folder in case it got sent there. If it's not there either, please let us know and we'll be sure to get one to you.

    Thanks!
    Deozaan
     
  48. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    Deozaan,

    Regarding my changes I added this section to the cinput file... (basically duplicated your function so as to have something to revert to in case I really messed up things)...

    //same as above but with logs for checking for now...
    private static float _GetCalibratedAxisInput1(string description) {
    //notice that this is running or has been ran
    //Debug.Log("_GetCalibratedAxisInput1 is running");

    float rawValue;

    for (int i = 1; i < _numGamepads; i++) {
    //numgamepads check...
    //Debug.Log("Num of game pad(s) is " + _numGamepads + " current value of 'i' is " + i);
    for (int j = 1; j < 10; j++) {
    //Debug.Log("Current value of 'j' is " + i);
    string _joystring = _joyStrings[i, j];
    string joyPos = _joyStringsPos[i, j];
    string joyNeg = _joyStringsNeg[i, j];
    //Debug.Log("Description is " + description + " _joyString is " + _joystring);
    //if (description == joyPos || description == joyNeg) {
    if (description == _joystring) {
    //int index = 10 * (i - 1) + (j - 1);
    //Debug.Log("I = " + i + " J = " + j);
    int index = 10 * (i - 1) + (j - 1);
    //Debug.Log("get calibrated axis input is " + _axisType[index] + " for " + description + "with a index value of " + index);
    switch (_axisType[index]) {
    case 0: {
    //Debug.LogWarning("Case is 0 for " + description + "with a raw value of " + rawValue);
    rawValue = Input.GetAxis(_ChangeStringToAxisName(description));
    return rawValue;
    //break;
    }
    case 1: {
    rawValue = Input.GetAxis(_ChangeStringToAxisName(description));
    rawValue = (rawValue + 1) / 2;
    //Debug.LogWarning("Case is 1 for " + description + "with a raw value of " + rawValue);
    return rawValue;
    //break;
    }
    case -1: {
    rawValue = Input.GetAxis(_ChangeStringToAxisName(description));
    rawValue = (rawValue - 1) / 2;
    //Debug.LogWarning("Case is -1 for " + description + "with a raw value of " + rawValue);
    return rawValue;
    //break;
    }
    }
    }
    }
    }

    //Debug.LogError("Failed to get any Cases for " + description + "using main raw value of " + rawValue);
    rawValue = Input.GetAxis(_ChangeStringToAxisName(description));
    return rawValue;
    }

    Then I changed the call around the bottom of the script to be...

    // joystick axis scanning
    if (_allowJoystickAxis) {
    for (int i = 1; i < _numGamepads; i++) {
    for (int j = 1; j <= 10; j++) {
    string _joystring = _joyStrings[i, j];
    string _joystringPos = _joyStringsPos[i, j];
    string _joystringNeg = _joyStringsNeg[i, j];
    float axis = _GetCalibratedAxisInput1(_joystring);
     
  49. Tweerfga

    Tweerfga

    Joined:
    Aug 13, 2013
    Posts:
    1
    Hello,

    I just got cInput and it's great!
    I did run into a bug however (a joyaxis returning [-1, 1] on controller 1 and [-0.002, 0.002] on controller 2, while holding down a joybutton).
    This of course might be fixed in v2.5.5 which is not in the asset store yet, so I was wondering if there was a ETA on that?

    Thanks.
     
  50. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    We've submitted 2.5.5 to the Asset Store twice. The first time it got rejected due to the installation script creating a new menu item (even though it was accepted for the past few versions with that new menu item). Hopefully it will be approved and on the Asset Store within the next 24 hours, but I'm afraid I can't say for sure.