Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ohiofi/70afef5855a078da0d607ee24733f503 to your computer and use it in GitHub Desktop.
Save ohiofi/70afef5855a078da0d607ee24733f503 to your computer and use it in GitHub Desktop.
private void OnCollisionEnter2D(Collision2D coll){
if (coll.transform.tag == "Player") {
var audioSource = GetComponent<AudioSource> ();
if (audioSource != null) {
audioSource.PlayOneShot (deathClip);
}
Instantiate(playerDeathPrefab, coll.contacts[0].point, Quaternion.identity);
sr.sprite = hitSprite;
//Destroy(coll.gameObject)
//GameManager.instance.RestartLevel (1.25f);
SoyBoyController obj = new SoyBoyController();
coll.transform.position = obj.startPosition;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment