Best way to walk on a mesh?

Blitz3D Forums/Blitz3D Programming/Best way to walk on a mesh?

I`m currently coding the players avatar to walk on an uneven mesh that I am using for terrain, but I`m having problems getting it to "stick" to the ground. It is floating a little above the ground ,and sometimes drops through when going uphill.
I am using linepick to detect the mesh below the avatar. Would using entitycollided be better for this?

What would be the best way to code walking on a mesh?

Hm... Have you examined the "driver.bb" car demo? It's in the "mak" folder in the B3D Samples. It uses four spheres to simulate wheels & utilizes terrain-based ground-oriented physics... You might be able to extract something from it.

If you're using linepick and dropping through the floor, try starting the linepick higher up and project it downwards a bit further - for example start it at the character's waist level and linepick down by just slightly more than the distance from the waist to the feet.

I'd suggest to use Sphere vs polygon collision for the character vs the ground/enviroment. Using both parameters allow ellipsoid collision. Now when you combine this with the linepick (and only apply gravity when no ground was picked) then you can define the ground angle the Chars starts sliding, but prevent sliding on almost flat surfaces, actually quiet natural. Something that is kind of tricky to achieve with Collision only, but very useful for the gameplay.

At least today I'd do it this way.