How do I make “hitboxes” that are separate from “hurtboxes”?

0 favourites
  • 5 posts
  • As I make the attack animations for my teamwork-based 2D playformer, I realize that I never tried to creating a separation between hitboxes and hurtboxes in Construct 3.

    What I’m trying to create is, for example, if you were playing Smash Bros. and it was Link vs Ryu or smth. They’re both on the ground and try to lunge out to hit the other, Ryu with his leg and Link with his sword. Ryu’s leg and Link’s sword collide. Ryu takes damage because his leg was hit by the sword, but Link takes no damage because even though Ryu’s leg hit his sword, the sword is not a part of Link’s body. In other words, because Link has a sword, his hitboxes extend further than his hurtbox does; his hitboxes are disjointed. Since Ryu does a lot of fighting with his fists and legs, his hitboxes don’t really extend past his hurtboxes as much.

    My player-controlled characters use weapons that extend past their body as Link’s sword would. My first idea was to create two separate collision polygons on the player character’s animations, but unless I’ve missed something I don’t believe there’s a way to assign two totally separate collision polygons to one animation frame. My second idea was to make the player characters into two separate entities, much like the Kiwi player character and its “base” and “mask” in the Kiwi Story sample game. The problem with this is, the way I see it, I would need to give every instance of a recurring enemy character with disjointed hitboxes so that I would have to say “thisenemy1’s base is attached to thisenemy1’s mask... thisenemy2’s base is attached to thisenemy2’s mask...” even though both “thisenemy”-s would be visually and functionally identical.

    If my second idea was indeed the best way to create hitboxes vs hurtboxes and there actually is a way to give recurring enemies disjoints without making a brand new entity every time, please tell me how I can do that. However, if there is a better/more intuitive way to create this hitbox-hurtbox separation, I would greatly appreciate if someone could tell me how or direct me to a video that explains it. Thank you in advance for your help!

  • The most straight forward approach to this is to create multiple collision boxes for the same character and pin them to his fists and legs, disable their collision check and only reactivate on specific a frames when the animation indicates that the character should inflict damage to the enemy. You don't need to eliminate them everytime you need to do damage check, just disable the collision of these boxes.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The most straight forward approach to this is to create multiple collision boxes for the same character and pin them to his fists and legs, disable their collision check and only reactivate on specific a frames when the animation indicates that the character should inflict damage to the enemy. You don't need to eliminate them everytime you need to do damage check, just disable the collision of these boxes.

    So I guess there is a way to create more than one collision polygon. I will have to look at this. Thank you!

  • I believe he meant create multiple sprites (boxes) with their own collisions pinned to the character. Enabling/disabling when needed.

  • I believe he meant create multiple sprites (boxes) with their own collisions pinned to the character. Enabling/disabling when needed.

    Ohhh I see. Thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)