void OnTriggerEnter2D(Collider2D col) { if (col.tag == "Player") { Debug.Log("hit"); pS = col.gameObject.GetComponent <playerStats>(); pS.Respawn(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag != "Player") { return; } player_stats.Respawn(); }