This is some random cube physics which for the most part works you just need to tweak it to fit the certain scenario. I could make it do that automatically but that would just decrease the efficiency even more. - You can replay your project by pressing the gray button in the left top corner of the screen. After that you need to press the green flag to go back - You can speed up or slow down the simulation using the SpeedMode Slider - You can also move the cube by pressing and holding down on it moving it around and rotation it by using the left and right arrow keys. - Y, X and Turn energyLoss all affect the corresponding variable making it more or less noticeable. - Then there is SinglePointStress which changes the amount of force on Y, X and Turn energyLoss depending on how much of the cube is colliding with the ground. - And last but not least we have CollisionFineness which changes how big of an outline around the square counts as a collision inevitably increasing the amount of collision which can be used to tolerate SinglePointStresses sometimes out of hand alteration. - My personal settings can be found by pressing 1 and 2. 1 - Is for ground collision 2 - Is for ledge collision
This is only brewed from right inside my head. When i was looking for cube physics on scratch i was surprised to see that not many people had made any and i had always been interested to see if i could so i began thinking about some ways to make it and came up with a system that when touching the ground it would shoot out 360 lasers in every single direction inside the cube and if it touched the ground add it to a list storing the direction it was pointing when colliding. Then I would move it by calculating the average of every single one and use triangulation to allow me to change the x force and y force independently. And that's how this got made plus a lot of other things but that is pretty much the basics.