Skip to main content
20 events
when toggle format what by license comment
Dec 7, 2017 at 18:09 vote accept Rupal Patel
Dec 7, 2017 at 17:36 history rollback Vaillancourt
Rollback to Revision 4
Nov 17, 2017 at 12:11 history edited Rupal Patel CC BY-SA 3.0
added 41 characters in body
Nov 17, 2017 at 5:33 answer added Rupal Patel timeline score: 1
Nov 16, 2017 at 21:12 comment added Rupal Patel if (Input.GetKeyDown (KeyCode.Escape)){ // Escape button pressed print("Escape"); } This code is working Problem was i was testing it through unity remote 5. that's why it was taking input from keyboard not from mobile, When i tested it by making apk its working
Nov 16, 2017 at 21:00 comment added Rupal Patel OnApplicationPause(){print("Escape");} works for editor not for mobile
Nov 16, 2017 at 20:45 comment added Stephan Another example I've found uses the Input.GetKey(KeyCode.Escape) for android. Down and Up might not apply for mobile.
Nov 16, 2017 at 20:29 comment added John Hamilton Try this instead (outside the update method): OnApplicationPause(){print("Escape");} and let me know how it goes. Also, @Stephan InputManager doesn't have the Escape as a key, it's a built-in keycode (at least it is so in the latest version).
Nov 16, 2017 at 20:27 comment added Stephan InputManager is in the menus, it allows you to set the default mapping for control input. it is the part of unity that set the values that you're accessing through the "Input.get..." methods. At this point I'm at a loss. That was the only difference I could see between your code and the tutorials out there. Checking InputManager is my last idea.
Nov 16, 2017 at 20:21 history edited John Hamilton CC BY-SA 3.0
We put codes in code blocks. You can find it on the bar above the text area when you're writing your questions or answers.
Nov 16, 2017 at 20:13 comment added Rupal Patel GetKeyUp also not working
Nov 16, 2017 at 20:13 history edited Rupal Patel CC BY-SA 3.0
deleted 12 characters in body
Nov 16, 2017 at 19:48 comment added Rupal Patel What to do with Input Manager ? I don't know about it. I am new in unity
Nov 16, 2017 at 19:37 comment added Stephan Examples I've found seem to use the GetKeyUp method rather than the GetKeyDown method. Try making the change and see if it works. Android may not send the keydown event.
Nov 16, 2017 at 19:28 review First posts
Nov 17, 2017 at 1:54
Nov 16, 2017 at 19:25 comment added Jesse Dorsey Can you try attaching the script to your Main Camera - or something that takes input?
Nov 16, 2017 at 19:22 comment added Rupal Patel Yes i take empty gameobject , and attached script with this gameobject. Update is executing but its not going to if stament. i am running game using unityRemote applciation in my phone
Nov 16, 2017 at 19:20 comment added Jesse Dorsey Is the script with this code attached to an object in the scene? Which object?
Nov 16, 2017 at 18:12 history edited DMGregory CC BY-SA 3.0
Code formatting, removing ambiguity about Update
Nov 16, 2017 at 17:26 history asked Rupal Patel CC BY-SA 3.0