Skip to content

Instantly share code, notes, and snippets.

@yandod
Created July 6, 2014 07:42
Show Gist options
  • Save yandod/24427808dea1031943c6 to your computer and use it in GitHub Desktop.
Save yandod/24427808dea1031943c6 to your computer and use it in GitHub Desktop.
ball
var original:Vector3;
function Start () {
this.original = transform.position;
}
function OnCollisionEnter(other:Collision){
if (other.gameObject.CompareTag('Player')) {
this.transform.position = this.original;
GetComponent('AudioSource').Play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment