godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.59k stars 21.1k forks source link

Vertical collision with one way collision platform when colliding with another body to the side #43973

Open Rhathe opened 3 years ago

Rhathe commented 3 years ago

Godot version:

3.2.3

OS/device including version:

Windows 10

Issue description:

There is a vertical collision as it goes up through a one way collision platform when it also collides with another body on top of the one way platform, leading to the kinematic body stopping completely instead of sliding up. In a platformer, this can lead to jumping through a one way platform, colliding with an NPC, and dropping immediately instead of sliding up the NPC collision box.

bug

What's expected is that the body stops horizontal movement but continues sliding up, shown when you disable the one way collision platform.

onewaybodydisabled

Steps to reproduce: Run the project.

Minimal reproduction project:

test_move_one_way_body_on_top.zip

Rhathe commented 3 years ago

Note: This not quite the same issue as #25967 and #43012, as removing the body on top of the one way platform lets the kinematic body pass through the one way platform, and removing the one way collision from the platform has the kinematic body collide as expected with the platform by sliding up instead of hugging the top of the platform.

Body on Top of Platform Disabled One Way Collision Removed
bodydisabled onewayremoved
Rhathe commented 3 years ago

This should be fixed by #38471