I am currently working on a basic First Person Controller along with some additional features such as jumping.
For the jumping mechanism I need to detect whether my player mesh is touching the ground or not.
A simple raycast, as seen in the image, does not suffice for me as this does not really allow me to walk up ramps:
The raycast does not detect that I am on top of a surface, hence why it thinks I am in the air, and thus apply air movement.
Now, to my actual question:
In Unity, to handle ground detection, you can use a “BoxCast” (Unity - Scripting API: Physics.BoxCast) to detect ground collision. Basically it performs a box-shaped raycast in the desired direction.
I’ve been looking through the BabylonJS docs and have not found anything similar to this sadly.
How would you be able to perform the equivalent of a box-shaped raycast in BabylonJS?
Any ideas are welcome.