InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

Adding "relative mode" to OnScreenStick

Open eblabs opened this issue 5 years ago • 8 comments

Hi, Currently, the OnScreenStick controller uses your first touch to determine a "start point". In many cases it's actually more helpful to always have the "start point" at the center of the joystick. Scenario, if I tap right on the controller, currently this would not register any movement because the origin of the movement is reset to this point. Ideally if I tap right, I would expect the controller to register this tap as being on the right side of the controller not at zero. I think this should be the default behaviour, please let me know your thoughts. Thanks!!

eblabs avatar Jun 03 '19 18:06 eblabs

Conceptually, seems right. I guess I don't know what common usage expectation for on screen sticks are, but I think it makes sense to add this option.

Would be good to have a test for this in Assets/Tests/InputSystem/Plugins/OnScreenTests.cs, though - and we need to run the code formatter script on this before landing, I don't think the indentation on this would pass CI.

jechter avatar Jun 05 '19 07:06 jechter

Thanks for your feedback @jechter.

Would you mind clarifying your comments on the formatting/indentation issues? Id be happy to make any needed changes.

Cheers,

Eric

eblabs avatar Jun 05 '19 15:06 eblabs

Don't bother with the formatting. We can fix that for you, when we land it. (We have automated formatting tools, and PRs will fail if they are not run, but I don't think this stuff is publicly available atm).

jechter avatar Jun 06 '19 07:06 jechter

Great, thanks @jechter. I'll leave this as is then...

Cheers,

Eric

eblabs avatar Jun 06 '19 17:06 eblabs

Great, thanks @jechter. I'll leave this as is then...

It would still be great to add a test in Assets/Tests/InputSystem/Plugins/OnScreenTests.cs, though.

jechter avatar Jun 06 '19 20:06 jechter

Hey @jechter, I'm not familiar with how your unit testing works. So I'll leave that up to you then. Thanks!!

eblabs avatar Jun 08 '19 04:06 eblabs

CLA assistant check
All committers have signed the CLA.

unity-cla-assistant avatar Jun 03 '21 08:06 unity-cla-assistant

Hi @jechter, I just resolved a conflict on my code, but of course please check it out when you have a chance. Thanks! Eric

eblabs avatar Jun 03 '21 12:06 eblabs

Thank you for the PR. We have taken your suggestion on board and will add this feature. We have an internal PR with this change here: https://github.com/Unity-Technologies/InputSystem/pull/1613

jamesmcgill avatar Dec 13 '22 17:12 jamesmcgill