// Update is called once per frame void Update() { Input.simulateMouseWithTouches = true; if (monitor.Flame <= 0) { forceHeld = false; } if ((Input.GetMouseButton(0) || forceHeld) && monitor.Flame > 0) { Vector3 position = Input.mousePosition; if (position.x > (Screen.width / 4) || forceHeld) { position = Camera.main.ScreenToWorldPoint(position); float xx = position.x - (gameObject.transform).position.x; float yy = Mathf.Abs(position.y) - Mathf.Abs((gameObject.transform).position.y); angle = (Mathf.Atan2(Mathf.Abs(yy), Mathf.Abs(xx)) * Mathf.Rad2Deg); Debug.Log(angle + "\n"); if (position.y < gameObject.transform.position.y) { angle *= -1; } timer -= Time.deltaTime; monitor.ChangeFlame((0 - Time.deltaTime) * p.breathMult()); Debug.Log(monitor.Flame); if (timer <= 0) { spawn = new Vector3(transform.position.x + Mathf.Cos(angle * Mathf.Deg2Rad) * xScale, transform.position.y); if (breath.spec1 || breath.spec2) { forceHeld = true; } if (breath.spec1) { bulletHell(); } else if (breath.spec2) { shoopdawhoop(); } else { normal(); } timer += breath.rate; if (soundTime <= 0) { soundTime = 5.0f; breath.play(); } } soundTime -= Time.deltaTime; } } }