Hello I can’t start the line where it says StartCoroutine(RespawnCo()); it’s highlighting red can anyone help me please
Thank you!!!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelManager : MonoBehaviour
{
public static LevelManager instance;
public float waitToRespawn;
private void Awake()
{
instance = this;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void RespawnPlayer()
{
StartCoroutine(RespawnCo());
}
private IEnumerable RespawnCo()
{
PlayerController.instance.gameObject.SetActive(false);
yield return new WaitForSeconds(waitToRespawn);
PlayerController.instance.gameObject.SetActive(true);
}
}
