Collision Masks (for Sprite objects)
In a Sprite editor, below all the animations, we find the Edit Hitboxes button.
Clicking on this button takes us to a new dialog that talks more about something known as collision masks. Collision mask, in simple terms, is nothing but the area of the sprite, that is in consideration while in a collision, to avoid situations, similar to the one shown below.
To add your own custom collision mask, click on the Use a custom collision mask option.
Click on the + sign at the bottom right of the screen to start adding your custom collision mask.
This will take you to the screen where you can enter/drag the outline of your collision mask. To add more points, click on the + sign below all the coordinates of your points. My final sprite collision masks look as shown below.
Please make sure that the polygon is convex, i.e. there are no vertices that have an angle greater than 180º
After adding the mask click on Close and then Apply.
The collision masks we used for our above example give better results in the same condition.
To add unique collision masks for different animations of the same sprite, disable the Share same collision masks for all animations option.
To add unique collision masks for different instances of the same sprite, disable the Share same collision mask for sprites of this animation option.