Skip to content

Instantly share code, notes, and snippets.

@carlows
Created April 16, 2015 15:50
Show Gist options
  • Save carlows/79f3759af1b2226e1439 to your computer and use it in GitHub Desktop.
Save carlows/79f3759af1b2226e1439 to your computer and use it in GitHub Desktop.
Get component
void OnTriggerEnter2D(Collider2D other){
if(other.transform.tag == "Player"){
var respawnScript = other.gameObject.GetComponent<Script>();
respawnScript.Respawn();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment