punchy
punchy copied to clipboard
Fix enemies hitbox
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
- Run in debug mode
- Turn on rapier debug lines
Expected Behavior
Hitboxes to appear in front of the enemy.
Couple extra comments for context: https://github.com/fishfolks/punchy/pull/224#issuecomment-1213167253.
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.
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.
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.