public void Shoot(Vector3 velocity, float lifetime) { GetComponent <Rigidbody>().AddForce(velocity, ForceMode.VelocityChange); lifePeriod = new TimePeriod(lifetime, Time.time); }