I don’t know if Phaser allows it, but I want to make two collision shapes for the player, one for hitbox of enemy attacks and another for interactions with the map. Like the image below:
On a more realistic game, the player could pass through with no problems, in other words, I need a collision close to the feet of the player and one to the full body for taking damage
Hi,
It isn’t possible to add another body.
Just reducing body size is enough, from mid head to foot, without the legs, and so player doesn’t get hit on transparent pixels. It’s the way old games are made (like megaman…)
I’m facing the same problem, although I’m not sure I understand your answer. Could you please explain a bit more?
I’m using a slightly tall character’s spritesheet with animations and I want two different collisions, for bullet hit and for map. I only want the map to collide with the players legs.
How do I enable collision only on non-transparent pixels?
No, what i said is to reduce the size of the body, example:
The sprite width is 16px, but there is 4px of transparent pixels each side.
So the body must have a width of 8px, and an offset of 4px to be centered
I would resize the sprite’s body to include his feet only, and then add a physics-enabled Zone as a damage box. Reposition the Zone on the player every frame.