Always Grounded When Jumping

Hey hey!

I’m following along via the 2dPlatformer tutorial, and can’t figure out/understand why my jump method isn’t behaving properly.

I think it’s due to the “grounded” bool, and the fact that it always return true, even when my player is in air.

grounded = Physics2D.OverlapCircle(groundCheck.position, groundRadius, whatIsGround); 

I’m pretty sure I’ve set everything up correctly in Unity (child object @ the player Layer); however, it appears to be permanently colliding even upon starting the game (in which my player is falling to the ground)

I’d be super appreciative if anyone can help a rookie out - as I continue to grasp c# and the Unity platform. Thanks again so much!

Full code below:

 // moving
    public float maxSpeed = 10f;
    
    // which direction i am facing
    private bool facingRight = true;
    
  // anim stuff
    private Animator anim;

    //Grounded / Falling
    public Transform groundCheck;
    public LayerMask whatIsGround;
    private bool grounded = false;
    private float groundRadius = 0.2f;

    //jumping
    public float jumpForce = 200f;

    // double jump
    private bool doubleJump = false;


    // Use this for initialization
    void Start () {
        anim = GetComponent<Animator>();
	}
	
	// Update is called once per frame
	void FixedUpdate () {
        grounded = Physics2D.OverlapCircle(groundCheck.position, groundRadius, whatIsGround); 
        // animation for grounded
        anim.SetBool("Ground", grounded);

        // doublejump
        if (grounded)
        {
            doubleJump = false;
        }

        //CHECKING IF GROUNDED UNTIL I CREATE ANIMATIONS
        if (grounded = true)
        {
            Debug.Log("Player is grounded");
        }
        anim.SetFloat("vSpeed", GetComponent<Rigidbody2D>().velocity.y);


        // cannot move left or right when jumping
        if (!grounded) return;
        
        // actually move
        float move = Input.GetAxis("Horizontal");

        // animation for moving
        anim.SetFloat("Speed", Mathf.Abs(move));

        GetComponent<Rigidbody2D>().velocity = new Vector2(move * maxSpeed, GetComponent<Rigidbody2D>().velocity.y);

        if (move > 0 && !facingRight)
        {
            Flip();
        } else if(move < 0 && facingRight)
        {
            Flip();
        }
	}

    void Update()
    {
        // jumping
        if ((grounded || !doubleJump) && Input.GetKeyDown(KeyCode.Space)) // should not do it this way, should map to a jump key so actual key can be changed (currently spacebar)
        {
            anim.SetBool("Ground", false);
            GetComponent<Rigidbody2D>().AddForce(new Vector2(0, jumpForce));

            if (!doubleJump && !grounded)
            {
                doubleJump = true;
            }
        }
    }

    // determine if facing left or right
    void Flip()
    {
        facingRight = !facingRight;
        Vector3 theScale = transform.localScale;
        theScale.x *= -1;
        transform.localScale = theScale; 
    }
}

hi;
did u set the Ground layer Correctly in the inspector ? ;
and try to change the GroundRadiuse maybe its different ;

Thanks for replying @Cuttlas-U.

The thing is my check for is grounded is firing even before my player hits the ground (falls upon play). I’ve played around with all sizes for groundRadius, but no improvement


I really think I did - but maybe I’m missing something small? Do you see anything off in the screenshots below? (8-bit Jesus IS NOT cooperating)

Player Inspector:

The GroundCheck inspector only has the transform and also has the Layer set to Player.

Any thoughts? Thanks again so much!