fishfolk / punchy

A 2.5D side-scroller beatemup, made in Bevy
https://fishfolk.github.io/punchy/player/latest
Other
265 stars 32 forks source link

Fix enemies hitbox #227

Closed edgarssilva closed 1 year ago

edgarssilva commented 2 years ago

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.

zicklag commented 2 years ago

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

odecay commented 2 years ago

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.

edgarssilva commented 2 years ago

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.

zicklag commented 2 years ago

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.