Matter JS



I am building a game using Matter JS and Phaser 3.
I wanted to change physics texture accordingly to the frame.
I can define the first texture as the example Physics Editor and Phaser shows, however I wanted to change when a frame changes.
How can I do that?

(the issue is similar to this post)


Ok. I was able to change the physics texture using:

this.shapes = scene.cache.json.get('heroPhysics'); 

And then change it in the update function of my sprite using setBody:

this.setBody(this.shapes[str], {});

This works fine to change the shape, however after this the position is set to (0,0). How can I do so just the shape is altered? And if I want to flip the sprite, how can I flip the body?