how to detect when something is grounded?

I’m working on a ragdoll system that transitions players from ragdoll to getting back up. How can I find if the ragdoll is on the ground and what his velocity is? So if he is moving faster than x or not grounded, he stays as a ragdoll.

Raycast straight down. The ray should be long enough to reach from the character’s center of mass/origin to the point where it the lowest part of the ragdoll. If you hit something, you’re grounded.

If you’re letting Physics handle the motion (gravity), then just record the distance traveled between Updates(). Divide this by Time.deltaTime, and you have your velocity.