Can not set the offset of Arcade Physics Body Geometry
k206i opened this issue ยท 7 comments
Please can you enable the physics debug? In that way we can know what's going on. In the game config, set:
const game = new Phaser.Game({
physics: {
default: "arcade",
arcade: {
debug: true
}
}
});
BTW, is it scaled the platform object?
Please, try without scaling the platform. Or you have to call the platform.body.updateFromGameObject()
method after you scale the platform.
https://newdocs.phaser.io/docs/3.60.0/focus/Phaser.Physics.Arcade.StaticBody-updateFromGameObject
BTW, I recommend you take a look at this tutorial. In this part it talks about refreshing the body after changing the scale: https://youtu.be/nMXOcrQU9cs?list=PLB8gI_5U0MvBiK7GExn8ONPk5jDPd2KlE&t=237
Please, try without scaling the platform. Or you have to call the
platform.body.updateFromGameObject()
method after you scale the platform.
It works for me. Thank you!
BTW, I recommend you take a look at this tutorial. In this part it talks about refreshing the body after changing the scale:
Thanks for your tutorials! They help a lot!