# Stop Sliding down Slopes (SSS)

**URL:** <https://forum.babylonjs.com/t/stop-sliding-down-slopes-sss/1558>\
**Category:** Questions\
**Created:** [February 22, 2019, 5:14pm UTC](https://forum.babylonjs.com/t/stop-sliding-down-slopes-sss/1558 "2019-02-22T17:14:52Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [February 27, 2019, 1:24pm UTC](https://forum.babylonjs.com/t/stop-sliding-down-slopes-sss/1558/17 "2019-02-27T13:24:12Z")

</div>

[https://www.babylonjs-playground.com/#CIFSQS#4](https://www.babylonjs-playground.com/#CIFSQS#4)

I finally got the “quadLazers” working. See console… to see the _distance_ samplings.

By constantly positioning (never rotating) this device… above a gravity-active freeCamera… we SHOULD be able to constantly know… what [mesh-angle](https://image.dhgate.com/albu_212688527_00/1.0x0.jpg)… our freeCam ellipsoid is always sitting-upon.

If you remember my previous post, I was getting unchanging 2.5 distance ALL THE TIME, from all 4 rayzer beams.

Well dummy me… I forgot to set the red BOXES for the rayzers… isPickable = false. The rayzers were measuring the distance to the bottom of their red boxes, because the rays are shooting-from red box centers.

So, now we see good distance numbers at console, as the ground plane tilts. I guess the next step would be to convert the distance values from the 4 rayzers… to a single angle in degrees.

If anyone would like to install that feature for us (for me), that would be fine.

The end objective… selective ramp-sliding from gravity-active freeCams.

If (currentAngle \< 30 & !camera.isNaving) { camera.applyGravity = false }

Something like that. We want gravity to turn-ON again… IF user moves cam position.

It might be difficult to test whether the user moved the cam, or some momentary ramp-sliding moved it. It might take some careful tweaking to activate/control this “smart sliding” system.

It might be wiser… to shoot only ONE rayzer downward and get the pickedMesh. Then use ITS .rotation or .rotationQuaternion… to derive a degrees-of-rotation (a slope-angle). That would require 75% less rays, which means we could perf-afford a much faster distance-sampling rate.

Help/ideas welcome. Thanks!

---

_[View the full topic](https://forum.babylonjs.com/t/stop-sliding-down-slopes-sss/1558)._
