using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerDeath : MonoBehaviour
{
    public Transform DeathPrefab;

    void Start()
    {
        StartCoroutine(WaitAndDie());
    }

    IEnumerator WaitAndDie()
    {
        yield return new WaitForSeconds(2);
        Instantiate(DeathPrefab, transform.position, transform.rotation);
        Destroy(this.gameObject);
    }
}
