void checkForGround()
{
Ray ray = new Ray(transform.position, new Vector3(0f, -1.1f, 0f));
RaycastHit hit;
Debug.DrawRay(transform.position, new Vector3(0f, -1.1f, 0f), Color.green);
if(Physics.Raycast(ray, out hit, 1, ~RayLayerMask))
{
Debug.Log("grounded " + hit.collider.gameObject.name);
isGrounded = true;
}else
{
Debug.Log("not grounded");
isGrounded = false;
}
}
void checkForGround()
{
Ray ray = new Ray(transform.position, new Vector3(0f, -1.1f, 0f));
RaycastHit hit;
Debug.DrawRay(transform.position, new Vector3(0f, -1.1f, 0f), Color.green);
if(Physics.Raycast(ray, out hit, 1, ~RayLayerMask))
{
Debug.Log("grounded " + hit.collider.gameObject.name);
isGrounded = true;
}else
{
Debug.Log("not grounded");
isGrounded = false;
}
}