void Update() { _rot = new Vector3(0, 0, _angle); transform.localEulerAngles = _rot; if (Input.GetKey(KeyCode.LeftArrow)) { _angle += _rotSpeed * Time.fixedDeltaTime; } if (Input.GetKey(KeyCode.RightArrow)) { _angle -= _rotSpeed * Time.fixedDeltaTime; } if (Ammobehaviour._fullAmmo.Count > 0) { if (Input.GetKeyDown(KeyCode.Space)) { Projectilebehaviour.Shoot(_shootSpeed); Destroy(Ammobehaviour._fullAmmo [0]); Ammobehaviour._fullAmmo.RemoveAt(0); GameObject obj = Instantiate(Ammobehaviour.getAmmoObj, transform.position, Quaternion.identity); Projectilebehaviour = GameObject.Find(); } } }