Phaser 3: Make object movement on the slope

Viewed 49
1 Answers

As I remenmber for your earlier question, I assume you are using arcade physics, with that in mind, the answer is, it is "impossible" to move on slopes, except you want to do excessive calculation or so.

The best option is, if you switch to matter physics engine (matter.js). There this would work easy, and without special calculation and/or hacks. Just check out this exmaple for the official website https://phaser.io/examples/v3/view/physics/matterjs/add-body-to-text.

There is one Caveat: the matter engine works and is configured abit different than the arcade engine, so you would have to update most of your physics code.

Related