Serious issue.

Hello guys.

using UnityEngine;
using System.Collections;

public class LevelManager : MonoBehaviour {

    public GameObject currentCheckpoint;
    public GameObject deathParticle;
    public GameObject respawnParticle;

    private PlayerController player;

    public float respawnDelay;


    void Start ()
    {
        player = FindObjectOfType<PlayerController> ();
    }
   
    void Update ()
    {
   
    }

    public void RespawnPlayer()
    {
        StartCoroutine ("RespawnPlayerCo");
    }

    public IEnumerator RespawnPlayerCo();
    {
        Instantiate (deathParticle, player.transform.position, player.transform.rotation);
        player.enabled = false;
        player.GetComponent<Renderer> ().enabled = false;
        Debug.Log ("PlayerRespawn");
        yield return new WaitForSeconds (respawnDelay);
        player.transform.position = currentCheckpoint.transform.position;
        player.GetComponent<Renderer> ().enabled = true;
        Instantiate (respawnParticle, player.position.transform, player.transform.rotation);
    }
}

for some reason it says I have a problem with my script never happened before, it says all the (GameObject) stuff are not exist in the current scene, I’m having headache coz of that and here’s my script, any help would be appreciated.

Exact error message plus line number?

Those are the errors :smile:
a ton of them lol.

Never mind found it,
that what happens when you code and you have been awake for quite long time, I’ve added (); to the void of the IE… stupid me.

thanks again for the help!

1 Like

Delete the semi colon on line 30

Edit: just saw your other message. Looks like you saw it already

1 Like