punchy icon indicating copy to clipboard operation
punchy copied to clipboard

Fix enemies hitbox

Open edgarssilva opened this issue 2 years ago • 4 comments

Description

When running the game in debug mode it is possible to see flashing boxes in the middle of the screen. This seems to be the enemies' attack hitbox that is not correctly placed.

To Reproduce

  1. Run in debug mode
  2. Turn on rapier debug lines

Expected Behavior

Hitboxes to appear in front of the enemy.

edgarssilva avatar Aug 12 '22 14:08 edgarssilva

Couple extra comments for context: https://github.com/fishfolks/punchy/pull/224#issuecomment-1213167253.

zicklag avatar Aug 12 '22 14:08 zicklag

Making a note, I thought this might just be a visual bug, but while I was changing around the stage border limits in #241 I walked up to where those hitboxes appear and they do in fact cause a collision with the player, which get picked up by our collision system.

odecay avatar Aug 26 '22 02:08 odecay

Making a note, I thought this might just be a visual bug, but while I was changing around the stage border limits in #241 I walked up to where those hitboxes appear and they do in fact cause a collision with the player, which get picked up by our collision system.

Yeah I also remember sometimes I would get hit just by walking around while the collider was snapping into position.

edgarssilva avatar Aug 26 '22 12:08 edgarssilva

Maybe it's a scheduling thing, where we are adding the collider as a child, but rapier doesn't get to updating the collider transform until the next frame or something.

zicklag avatar Aug 26 '22 13:08 zicklag