My character is falling through the ground

For some reason my fox is falling through through the ground and I can’t figure out why. Can someone help?
basically, when I press play my character falls through the ground at light speed. If you need any information about my project feel free to ask.

Also, both the ground and character have colliders

Here’s my code (sorry for the mess, it’s a work in progress):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Move : MonoBehaviour
{

Rigidbody2D rb2d;
SpriteRenderer spriterender;
BoxCollider2D bcol;
Vector2 ogsize;
[SerializeField] private LayerMask platformLayerMask;
[SerializeField] Transform ceilingcheck;
[SerializeField] Transform crouchpoint;
[SerializeField] Vector2 sizeocheck = new Vector2(0.0658203f, 0.09773837f);
bool crouch = false;
//bool turn = false;

/*void Flip()
{
    turn = !turn;

    transform.Rotate(0f, 180f, 0f);
}*/

private bool IsGrounded()
{
    RaycastHit2D raycastHit;

    raycastHit = Physics2D.BoxCast(bcol.bounds.center, sizeocheck, 0f, Vector2.down, 1f, platformLayerMask);
    return raycastHit.collider != null;
}

// Start is called before the first frame update
void Start()
{

    rb2d = GetComponent<Rigidbody2D>();
    spriterender = GetComponent<SpriteRenderer>();
    bcol = GetComponent<BoxCollider2D>();
    ogsize = new Vector2(bcol.size.x, bcol.size.y);
}

// Update is called once per frame
void FixedUpdate()
{

    ///////walk//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /*if (Input.GetKey("d") && turn == false || Input.GetKey("right") && turn == false)
    {
        //Flip();
        rb2d.velocity = new Vector2(4, rb2d.velocity.y);
        transform.Rotate(0f, 0f, 0f);
    }

    else if (Input.GetKey("a") && turn == true || Input.GetKey("left") && turn == true)
    {
        //Flip();
        rb2d.velocity = new Vector2(-4, rb2d.velocity.y);
        transform.Rotate(0f, 180f, 0f);
    }

    else
    {
        rb2d.velocity = new Vector2(0, rb2d.velocity.y);
    }*/

    Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, 0f);
    transform.position += movement * Time.deltaTime * 4f;

    ///////jump//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (IsGrounded() && Input.GetKey("space") || Input.GetKey("up") && IsGrounded())
    {
        rb2d.velocity = new Vector2(rb2d.velocity.x, 17);
    }

    ///////crouch//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (Input.GetKey(KeyCode.LeftControl))
    {
        crouch = true;
    }

    if (crouch == true)
    {
        rb2d.velocity = new Vector2((rb2d.velocity.x) / 2, (rb2d.velocity.y) - 5);
        bcol.offset = new Vector2(crouchpoint.position.x, crouchpoint.position.y);
        bcol.size = new Vector2(bcol.size.x, bcol.size.y / 2);
        Debug.Log("crouching");
    }

    else if (crouch == false)
    {
        rb2d.velocity = new Vector2(rb2d.velocity.x, rb2d.velocity.y);
        bcol.size = ogsize;
        Debug.Log("standing");
    }

    // redo
    if (Physics2D.OverlapBox(ceilingcheck.position, sizeocheck, platformLayerMask))
    {
        crouch = true;
    }
    else crouch = false;

}

}

@Neometalsonic5 Have you assinged the platforms layermask you want to stand on to the platformLayerMask in the Inspector? That could be the Problem, otherwise check the Object you want to stand on in the Inspector an look if the Layer next to the Tag option is still unnamed, if so you have to select the same Layer as the one you assinged to the platformLayerMask in your Inspector.

You say it goes through at light speed, your sprite is probably moving too fast to collide then. Try continuous collision detection, making your player fall slower or making your colliders bigger.

I ran some tests and I think the problem is with my crouch code. I think that what’s happening is that the collider gets too small.

Ok, I fixed it. I think what happened is that you can’t associate offeset with position, if you do the collider will disappear. Also, the collider was constantly decreasing.