Forum begins after the advertisement:

 


[General] Not All Code paths return a value console error

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [General] Not All Code paths return a value console error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17877
    My
    Level 10
    Bronze Supporter (Patron)
    Helpful?
    Up
    0
    ::

    Current Code:

      IEnumerator Death()
        {
            pState.alive = false;
            Time.timeScale = 1f;
            GameObject _bloodSpurtParticles = Instantiate(bloodSpurt, transform.position, Quaternion.identity);
            Destroy(_bloodSpurtParticles, 1.5f);
            anim.SetTrigger("Death");
    
            yield return new WaitForSeconds(0.9f);
        }

    Console is returning an error: not all code paths return a value. help

    #17878
    Terence
    Level 31
    Keymaster
    Helpful?
    Up
    0
    ::

    Your code doesn’t seem to have anything wrong. Try adding some spaces after your yield return statement, save and try again.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: