I know there is alot about ground detection out there. but i dont need to know if the character is grounded but when he leaves the ground and when he hits the ground again. anybody have some tips?
I would make a small region below the character that constantly monitors whether there’s ground in there using Physics2D.OverlapBox method.
The character would be considered to have left the ground once that region no longer detects any ground inside it. After that, once the region detects the ground again, that would be considered a landing.
If you’re interested in the height the player fell from, I would calculate the distance from the highest point the character was after jumping to the point where it detected the ground again.
Here’s a reference: