This is the code given by Unity docs for a double tap that makes a projectile. I would like to learn how this code works and if possible, how I can edit it even further, for example, make it a single tap instead of a double tap. Thanks
var projectile : GameObject;
function Update () {
for (var i = 0; i < Input.touchCount; ++i) {
if (Input.GetTouch(i).phase == TouchPhase.Began) {
clone = Instantiate (projectile, transform.position, transform.rotation);
↧