PhaserEditor2D/PhaserEditor2D-v3

Can not set the offset of Arcade Physics Body Geometry

k206i opened this issue ยท 7 comments

k206i commented

Version

  • Phaser Editor 2D Version: 3.60.1
  • Operating System: Windows 10
  • Web Browser and version:Opera GX LVL4 (core: 97.0.4719.89)

Description

Offset of Arcade Physics Body Geometry not working.
I have seted some offset:
image

But body has collide like offset was not set:
image

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?

k206i commented

Please can you enable the physics debug? In that way we can know what's going on. In the game config, set:
image

BTW, is it scaled the platform object?

Yes, this is a scaled platform prephab
image

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

k206i commented

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!

k206i commented

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!