Or a percentage, in a very indirect way, getting back to the touch. I'd love to get, in -1 to 1 range, raw or not, the exact current position of the LeftStick (a Vector2 possibly).ĭoesn't matter how I fiddled, but Value, X, Y, almost everything seems to return the current delta. Everything works fine with a workaround, but it's definitely ugly. I mapped a TouchTrackControl to the LeftStick. I believe I'm struggling for something which probably is so obvious that I can't see it. Question: What's the most direct way to get the absolute current position of the touch inside the window/rect specified by the TouchTrackControl? (which, of course may or may not be full screen, or just a scaled part of it?) (Patrick, I sent a second email but probably got lost in the process, so I'm also asking publicly since I believe it's trivial ) I wouldn't modify the original, just for the sake of maintenance for yourself going forward and it has other ties in the code for listening for user bindings, but since it's a toggle in your settings and you're presumably manually adding the binding it should be simple and you can also strip out anything to do with saving or loading the binding, unless you really want to add that.ĪddBinding can take any BindingSource as a parameter, so once you have your custom one just call Fire.AddBinding( new M圜ustomDeviceBindingSource( InputControlType.Action1, InputControlType.Action2 ) ) įor a more convoluted example, I've got an experimental ComboBindingSource (download here: ) which does a whole lot more than you need, but allows combining keyboard, mouse and device controls into a single binding. Honestly, if you copied DeviceBindingSource and called it something else it would take only very minor modifications to add a second InputControlType parameter. However, it would not be hard to implement a custom binding source yourself. If you have a full working profile, you are welcome to send it to me for official inclusion in the package.Click to expand.Unfortunately, this isn't a built-in feature. 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(). Then copy one of the profiles in InControl/Source/Unity/DeviceProfiles and adjust it accordingly. Fiddling with the controls will show you which inputs respond as which buttons and analogs. The controller should come up as an unknown controller if InControl doesn’t support it and will list a bunch of analogs and buttons. It’s not very hard but takes a little bit of manual trial and error.įirst, you’ll want to fire up the TestInputManager scene on device (or run it in the Unity editor for desktop systems). You can create the profile yourself if you like. Unfortunately adding support for controllers involves actually having them physically present to create and test the mappings. If you have a combined TwoAxisPlayerAction you can set it on that too.Ĭlick to expand.Possibly, although you can add support yourself. You can do that with the StateThreshold property: 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. 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. 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. see test.csĮDIT: This is intended behavior, here is their response to anyone else running into this problem in the future. Press any direction 1 time and it will log the other presses.ĮDIT: Tried it out using a different setup and i get the same results. I set this up in an empty project only with inControl imported. When i press in any direction it calls the other directions though. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |