Okay, I am neck and neck to completing my first game from scratch. My only problem now is that the game over screen does not show up after the player has died. This is the code that I have for it thus far.
using UnityEngine;
using System.Collections;
public class destroy_ship : MonoBehaviour {
public GameObject explosion_prefab;
void OnCollisionEnter2D (Collision2D col)
{
if(gameObject.name == "ship_main")
{
Destroy(gameObject);
}
{
Instantiate(explosion_prefab);
Destroy(gameObject);
}
}
void GameOver()
{
if(gameObject.collider2D);
Application.LoadLevel("Deadscreen");
}
}
Any help with this one? Thanks!