Is there a way to detect the size in world space of an object with which you collide?

I’m wondering if there’s a way for me to detect the y distance of a platform with which I am colliding. Like, if I’m right up against a block (i.e. my character is colliding with the ground), can I detect how many units long (the y units) this ground block is so that I can use that value to manipulate character movement?

So far I’ve tried getting the collider size of the object with which I’m colliding, but since colliders can be 1x1 and still cover a massive or small object that does not work.

You can use the renderer.bound.size, will give you the actual size:

 Renderer _goRend =GetComponent<Renderer>();
  Vector3 _size = _goRend.bounds.size;

You can also use the size of the collider, but will have to multiply to account for scale(I think):

Collider  _col= GetComponent<Collider>();
Vector3 _size=_col.bounds.size;

Renderer will give you the actual size you see. Size.x=Width, Size.y=height, Size.z=Length