More reliable way to check if the player is on the ground? | Character Physics Controllers

Is there a more reliable way to check if the player is actually on the ground when using the Character Physics Controllers?

The Sensor.SensedPart method of telling whether or not the player is actually on the ground isn’t the best, as the SensedPart is based on the search distance and therefore exists before the player is actually grounded.


(example of SensedPart existing when the player isn’t fully grounded)

For example, I’m using this kind of detection for my jumping and it makes it so the player can jump before landing. (This is not desirable)

Any alternatives? Other than raycasting, for starters.

I’m unfamiliar with GroundSensor, so maybe someone else could help with that.

Personally, I suggest using a raycast from the head/humanoidRootPart straight down and whitelist anything considered a floor. Might not be the best method but its a method.

I’m using raycasts right now. I was hoping for a better solution.
I wish they would work on these controllers more, as there are quite a few hardships I’ve come across while using these controllers. For one: The movement vector completely overrides momentum, which makes me have to use my own forces if the player is to want to slightly change directions while moving at speeds beyond this BaseMoveSpeed * MovementSpeedFactor vector, else the player would end up losing all its speed.

I remember thinking there were disadvantages to having a lower search distance, but now nothing really comes to mind. Maybe if it had more of the features of the default humanoid, but idk. Right now, I think the easiest thing to do is to probably just set the search distance to the lowest number (0.25 above ground offset) it could go to without causing any goofy behaviors.

The best thing to do here is probably to make a custom sensor taking in the information from a shapecast of the humanoid root part. This would probably be better in every case, but then again, I’m not too sure on how the read only sensor gets it’s information (It says it runs the exact Humanoid sensor code, but there are multiple noticable deviations, such as the sensor often covering too small of an area).