Stop Sliding down Slopes (SSS)

YOU could make it happen. You’re a BabylonJS pro these days… climbing the learning curve with a jet-powered bulldozer. :slight_smile: Doin’ good!

Early tests. I know as much about Rays… as I do about making Dingleberry Pie. But I can borrow one of the demos from the docs… and make a mess of it. I’m good-at making messes! :slight_smile: Don’t ask me what those “I68” and “I54” numbers in the docs… are all about.

But, I heard a rumor that rays are SLOW… if used wrong, and that they have the ability to measure distance to the SURFACE of another mesh (as opposed to the distance to the ORIGIN of another mesh).

So, I built 4 lazerRays hovering over a ground plane. I am shooting beams downward from all 4, with an extra beam shooting diagonally for some unknown reason.

In lines 82-96 (the render loop)… I am firing the lazers at a fairly slow rate. Pitchew, pitchew, ubitchu… and watching console for changes in “distance”. In lines 94/95, I am slowly tilting the ground. But I see few/no changes in distance at the console. It seems to love being 2.5.

Its a hat… for players to wear… to help them stay level-headed. ar ar ar!

Once we get this working, Givo… we will likely NOT parent this to the camera. Instead, we will need to keep the 4 parented-to-a-gizmo lazerRays… VERY level… yet hovering above camera. It would be something in the render loop like… quadLazer.position = camera.position.clone().add(new BABYLON.Vector3(0, 2, 0)) … always keeping it 2 units above camera. (the clone() section might not be needed). QuadLazer can be invisible and so can its beams.

Help welcome from all, of course. There’s some ray gods (god rays?) around here. Let’s hope they come out of the closet and help us find a pot of gold (golden pot?). :slight_smile: