Error in Raycast Detect Ground for Falling Animation

Ive been working on a controller for my game for a couple days now and its been going very smoothly however I ran into this small bug where the fall animation would play when a Ray Cast is determind but the character’s Capsule Collider (radius of 0.3) still collides with the wall edge and therefore the model stays on the edge but plays this falling animation.

I have the image here to best explain what goings on:
Screenshot - e34f79cfe762f930921ee22f3182cb2e - Gyazo

I know the issue here is that I only have one ray cast that is very slim and since the radius of the character is 0.3 theres a small slight error in which the raycast would not hit the ground thus thinking it should play the animation but the collider still does.

Heres the code:

//grounding checks
bool grounded = true;
public bool Grounded { get { return grounded; } }
private RaycastHit groundHit;
public float groundedDistance = 1.5f; // from capsule center
public LayerMask groundLayers = -1;
private float groundheight = 0.0f;
void Update () {

	//check if grounded
	grounded = Physics.Raycast (unit.position + unit.up * capcolllider.center.y, unit.up * -1, out groundHit, groundedDistance, groundLayers);
	anim.SetBool ("grounded", grounded);

Here is the setup:

Also I have 3 fall Landing animations that I would like to play when the character hits the ground at particular heights. As of right now I just have one playing but I would like to play the others depending on the height of the fall. If the fall is 0-3 unit meters then play LandA, if 3-10m then play LandB and then greater than that then LandC (which is basically a death falling animation).

I know to achieve this I just need to measure the distance of the Raycast itself but Im not quite sure how, still a little new to raycast functions

An easy fix would be to simply have the wall on a different layermask. With the collider that small you’re kind of asking for these types of problems. If a separate layermask if out of the question, perhaps you could also check the tag or name of the hit object.

For measuring distance, I believe RaycastHit.point will get you started. Unity - Scripting API: RaycastHit.point

Hopefully this helps. Best of luck.