Collision mask for different sub-images of the same sprite

konjecture

Member
So, I have a bat sprite that has its own collision mask when the batter is not swinging it, however, I have created another sprite which has 4 sub-images that mimic the animation of a swinging bat. Since these images are all at different angles and positions, so I would like them to have different collision masks and origin points covering the bat at different positions.

How can I do this from the sprite editor? Essentially, I would like every sub-image to have its own collision mask and origin point which covers the bat that is on that particular sub-image. After searching on the internet, I found some people saying that there is an option to enable separate collision masks for sub-images, but I cannot seem to find it?
 

HayManMarc

Member
You can do that in the sprite resource, however you should ask yourself if the game will really benefit from this much exact collision. The animation probably happens fast, so a timed collision area for where the bat swings could be enough.
 

Slyddar

Member
If you set the collision mask to "Precise Per Frame" it will be slower to process, but it will use a different mask per frame based on the sprite. It won't change the origin, but you don't need to do that if you use the player origin as the basis, and flip the hitbox if needed. Just create an attacking hit box instance per frame when required, and assign the image_index accordingly.
 
Top