public DespawnMeteorite ( Meteorite, meteorite ) : void | ||
meteorite | Meteorite, | |
Résultat | void |
void Update() // Move forward! (The rigidbody is kinematic, so movement comes from the transform) { if (transform.position.magnitude > maxDistance) { demoControl.DespawnMeteorite(this); } transform.position += transform.forward * speed * Time.deltaTime; }