- Home /
What will happened to other key "E" build for mobile
If the game required more than tap and move then for example entering vehicle need "e" key then in tap screen device like android or ios how do you enter the vehicle?
If you cant... is there a solution for this?
Hmmm, I think you're saying that if your PC build wants you to press the E key how would you di this on mobile?
This is a design question, so the mobile app would need to have something like a double tap to enter a vehicle or a button appear the player can tap to enter a vehicle.
Your UI may be different from one platform to the other and typically should be - leveraging the best input methods that platform has to offer.
Yes and I nvr test what happened if you already create for pc and produce for mobile is that meant the character cannot enter the vehicle or somehow can?
I meant... if somehow unity automatically help assign it?
Answer by GeekOfGeekAndDad · Jul 23, 2012 at 09:00 PM
Alas, Unity will not auto-assign any tap gestures to key commands, nor is there a trivial way to do this.
However, you can write code to detect a double-tap using touch.tapCount
and then, where you are already detecting a press of the "E" key:
if (doubleTapped || Input.GetKeyDown(KeyCode.E)) { // Enter Vehicle }
Where doubleTapped
is a variable you set in your touch handling code.
Unity makes it very easy to make your app cross-platform, but you usually need to rewrite your input code when you switch between desktop and mobile.
(Of course, if anyone knows of a way to make unity auto-detect gestures like double-taps and interpret them as key commands, I'd love to know about it too, but I couldn't find any outside of buying various plugins in the Asset Store, which could be another option for you.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613074555im_/https://answers.unity.com/themes/thub/images/avi.jpg)