Yellow can give more specifics, but it was basically just a ray cast pointing up detecting if you would collide or not... Their was a point where you could chain scale, but if you scaled too fast it broke the detection and allowed you clip through the celling... Although I believe their is still a point in the game that breaks because their isn't any detection on how wide you can be......