Hi,
You could try rigidbody setup plus set velocity (up)? I recall I'm using this, and it works well (cannot check at the moment).
Note, the setup below is a bit fancy. You technically only need a button press, set velocity (passing through the state, finish) and back. The gravity takes care of it. But you probably want to polish it up, and have falling and landing etc.
The setup I build works like this: The first state listens for button down. I also get velocity up/down every frame. Also, every frame compare this float whether it is below zero, give a bit of threshold. If so, it means the character is falling (goes into a falling state).
On the state after the button, set the velocity. It only passes through that one. Afterwards another velocity/compare state like at the start, to detect whether the character is still rising. If not (velocity is negative), move into a following falling state. I use a different one there. I think I again do the velocity/compare pair once more, this time, waiting for velocity to be zero or positive — because that means the character has landed on something.
This way, I also don't need collision detection or rays that detect the grounded state — but I don't know if this method is superior. I also have a few more details in there, like jump height based on button pressed, and I also add downwards velocity after falling, but that's choice (makes it snappier and better in my view).