Hey guys i would like to change the physics shape of a body from the rectangular of default to a shape made by myself. I have written this code, but it doesnt work… someone can help me? I need this because i want to set a perfect collision boundary
Code:
var arnShape = new Phaser.Geom.Polygon([
171, 425,
4, 330,
5, 322,
0, 314,
35, 291,
36, 256,
7, 238,
4, 230
]);
var arn = this.physics.add.sprite(1850, 650, ‘image2’).setOrigin(1, 1)
.setInteractive(arnShape, Phaser.Geom.Polygon.Contains);