Detect touch input
Hello , Im making game where you shoot up , I want to port it to android and IOS but I dont have experience working with touch screens ,
So my player shoots when you press SPACE , I want to shoot when the screen is touched , how can I do that
Answer by doublemax · Sep 02, 2016 at 06:51 PM
Use Input.GetMouseButtonDown(0) like checking for a click of the left mouse button. Touch inputs are mapped to that.
If you need anything specific to touch, search the documentation for Input.* and look for "touch". https://docs.unity3d.com/ScriptReference/Input.html
Your answer
Follow this Question
Related Questions
touch.position values clearification 0 Answers
Touch does not work with the new Input System 5 Answers
How to replace KeyCode.Space with a simple tap on Android? 1 Answer
ScreenToWorldPoint on One Axis? 0 Answers
iOS touch delay? 0 Answers