Is there a way to auto resize sprite bodies to fit the current texture frame size?
I have an animated sprite with an atlas and a few of the frames are different sizes (Player Duck for example). I’ve enabled debug to see the boundaries of the sprite body.
The trouble is the body appears to take the size of the first frame in the atlas, so when the animation moves to a smaller frame, a gap appears as the smaller frame seems to be attached to the top of the body box, leaving empty space below it.
I did come up with this solution in the update function:
player.body.setSize(player.frame.width, player.frame.height);
And the body does change size to fit the frame. But because gravity is enabled it falls to the ground.