December 2013
Beginner
320 pages
8h 22m
English
For making use of the touch inputs, we will need to add a single script to our player's ship:
TouchShoot.LayerMask is used to selectively hit objects with a raycast. There are essentially a lot of layers that should be hit. This one will be used to determine what the player can or cannot shoot.public LayerMask touchMask = -1;
Update function is the only function in this script. It starts with a loop. The Input class provides us with the touchCount value, which is simply a counter for how many fingers are currently touching the device screen.public void Update() { for(int i=0;i<Input.touchCount;i++) ...Read now
Unlock full access