Skip to content

Instantly share code, notes, and snippets.

@trentrand
Last active July 27, 2016 22:56
Show Gist options
  • Save trentrand/17a38558f0adfe5cb4e73349dac2c176 to your computer and use it in GitHub Desktop.
Save trentrand/17a38558f0adfe5cb4e73349dac2c176 to your computer and use it in GitHub Desktop.
void Start() {
StartCoroutine(resetPositionOnInterval());
}
IEnumerator resetPositionOnInterval() {
yield return new WaitForSeconds(5.0f);
// Reset position, then wait another 5 seconds
transform.position = initialPosition;
StartCoroutine(resetPositionOnInterval());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment