// Update is called once per frame void Update() { if (Utilitys.to(spawntime, Time.time) >= lifetime) { Destroy(gameObject); } else { gameObject.transform.position += gameObject.transform.forward * speed * Time.deltaTime; } }