Destroying and Respawning Player Issues.

In my PlayerControl script I have the following which destroys the player and spawns an explosion. This works great. However, I do want to have more player lives so I’m messing with respawning which also works. I’ll crash into an enemy and will respawn to my specified spawnpoint.

The problems come when I want to do both. It runs the first method but never the second. How would I set this up syntax wise? Do I have to put another IF Statement in that says If player is destroyed then respawn or something?

private void OnTriggerEnter2D(Collider2D other)
{
    if(other.CompareTag("Enemy"))

    {
            DestroyShip();
            Respawn();
    }

This is my destroyShip method & Respawn one

void DestroyShip()
    {
        Destroy(gameObject);
        GameObject e = Instantiate(explosion) as GameObject;
        e.transform.position = transform.position;
void Respawn()
    {
        this.transform.position = spawnpoint.position;

    }

Why not simply call the respawn ship within the DestroyShip method? Get rid of the Respawn(); call in the OnTriggerEnter2D and put it as the last command in DestroyShip.

You could even put the respawn line in the Destroy but maybe better to keep them separate in case you want to do more stuff.

Well, it doesn’t really seem to matter as the end result is still the same.

if(other.CompareTag("Ground"))
        {          
            Destroy(gameObject);
            GameObject e = Instantiate(explosion) as GameObject;
            e.transform.position = transform.position;
            this.transform.position = spawnpoint.position;
        }

My player gets destroyed and an explosion gets spawned at the collision point. But, nothing repawns. I also tried putting my Respawn() method inside my DestroyShip() one at the end at get the same result. I’m starting to wonder if something in the explosion part is messing with the repawn stuff.

I’ll give another go at someone else’s respawn tutorial tomorrow and see if that will change my predicament.