void Update() { if (Input.GetMouseButtonDown(0)) { bulletAmt--; if (bulletAmt <= 0) { GameManager2.OnDuckMiss(); } Vector3 mousePos = Input.mousePosition; mousePos.z = Camera.main.transform.position.z; if (Physics.Raycast(Camera.main.ScreenToWorldPoint(mousePos), Camera.main.transform.forward, out hit, Mathf.Infinity)) { { if (hit.transform.tag == "Duck") { DuckHealth movement = hit.transform.GetComponent <DuckHealth>(); } } } } }
public void DirectionChanger(Vector3 _dir) { Direction = new Vector3(Direction.x * _dir.x, Direction.y * _dir.y, 0); bounce++; if (bounce >= bounceMax) { Direction = new Vector3(0, 1, 0); GameManager2.OnDuckMiss(); } }