- Home /
Mobile Input - Sensitivity, Gravity Matching InputManager's Key
I've been working on a game primarily for PC, using Unity's InputManager for simple left/right movement (Horizontal Axis, mapped to keyboard keys). The game is to be ported over to Android, however I'm having difficulties getting the touch input to match the PC input.
The problem I face, is that when pressing 'Left' or 'Right' on the PC build, I'm using the Horizontal Axis to determine which way to move the player. This has the benefit of the built-in Sensitivity and Gravity to make movement smooth.
For mobile, I no longer have access to use the Horizontal axis (or so I have concluded through research) via touch only. I am simply detecting the first touch point on the left or right side of the screen to move in the respective direction; ideally, I want this to act exactly as the PC version does, with the same Sensitivity and Gravity.
It looks like simulating a key-press is a no-go, and I believe I might be able to achieve this with use of a timer and by lerping about a curve, however as I want this to remain 1:1 (play the same) as the PC version, I'd need to know the exact implementation used by Unity's InputManager re: Axis and Keys (not analog stick).
If there's an asset that can handle both touch points / key presses the same, and in a similar fashion as Unity (with Sensitivity and Gravity) that solves this problem more easily, I'd take that as an answer too!
Many thanks!
Your answer
Follow this Question
Related Questions
Tie touch logic into InputManager 0 Answers
Touch Input positions are different on iOS and Android? 2 Answers
EventSystem.current.IsPointerOverGameObject(t.fingerId) - Not working on Android builds - Unity 2 Answers
Touch.ScreenPosition doesnt work ? 0 Answers
MobileSingleStickControl Question 2 Answers