public void Die() { GameObject explodingPlayer = Instantiate(explodingPlayerPrefab, transform.position + new Vector3(0, 1, 0), Quaternion.identity); Explodable explodable = explodingPlayer.GetComponent <Explodable>(); explodable.fragmentInEditor(); explodable.explode(); explodable.setVelocity(GetComponent <Rigidbody2D>().velocity); Destroy(this.gameObject); onDied.Invoke(); Time.timeScale = 1f; Time.fixedDeltaTime = 0.02F * Time.timeScale; }