// Update is called once per frame void FixedUpdate() { transform.position += dir * speed * Time.deltaTime; Vector3 point = controller.GetComponent <PlayerController>().mainCam.WorldToViewportPoint(transform.position); if (!(point.x > 0 && point.x < 1 && point.y > 0 && point.y < 1)) { this.gameObject.SetActive(false); controller.unUsedBullets.Add(this.gameObject); } }