Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hitbox issue with all charaters #2

Open
shreyasrawat opened this issue Feb 13, 2023 · 1 comment
Open

Hitbox issue with all charaters #2

shreyasrawat opened this issue Feb 13, 2023 · 1 comment

Comments

@shreyasrawat
Copy link

Platformer.2023-02-12.17-35-49.mp4
Platformer.2023-02-12.17-36-23.mp4
Platformer.2023-02-12.17-34-04.mp4
Platformer.2023-02-12.17-34-55.mp4
@Varun-Jethani
Copy link

The issue is that we are trying to check pixel perfect collisions and when we do that the hands kind of collide with block. As we have declared in code that check for vertical collisions is done by checking if the player and any object are colliding when the player is moving in the vertical direction, so when it detects that very specific collision it puts it back on the top of the block but the player keeps falling in middle air due to the hand collide. A fix isn't absolutely necessary but there can be 2 ways one is to let go of pixel perfect collisions completely and assign hitboxes, the other would be to write a code that checks if the player is actually hitting the bottom or from somewhere in the middle of its 'rect' so if this happens it should move a little in the direction its facing this would make the player fall of after 2 or 3 such moves but this isn't ideal as it is possible that the player is facing in other direction than the direction of the object he is falling from but that's all I could do . I have attached the video of the second fix

Platformer.2023-12-28.02-14-27.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants