I am trying to create a coroutine, but for some reason visual studio doesn't like it, can somebody help me:
public IEnumerator RespawnPlayerCo()
{
Instantiate(deathParticle, player.transform.position, player.transform.rotation);
player.transform.position = currentCheckPoint.transform.position;
player.GetComponent().velocity = Vector3.zero;
Instantiate(respawnParticle, player.transform.position, player.transform.rotation);
}
It doesn't like the part where it says "RespawnPlayerCo" it says that not all code paths return a value.
↧