void FixedUpdate() { if (isPlayerAtTheEndOfPlatform) { if (Input.GetKeyDown(KeyCode.Q) || (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)) { high = 0; } if (Input.GetKey(KeyCode.Q) || (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Stationary)) { if (high == 0) { myWall = Instantiate(wall); myWall.transform.position = new Vector3(Generate.EndOfPrevPlatform, 0.5f, 1); Generate.AddElement(myWall); IsPlatformExist = true; } high++; myWall.transform.localScale = new Vector3(myWall.transform.localScale.x, high / 6, myWall.transform.localScale.z); } } }