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

KinematicBody2D doesnt move with platform if it has another KinematicBody2D on top of it. #49497

Open
Tracked by #45334
azagaya opened this issue Jun 10, 2021 · 4 comments

Comments

@azagaya
Copy link
Contributor

azagaya commented Jun 10, 2021

Godot version

3.3.x (018ca6b)

System information

Ubuntu 20.10, GeForce GTX 1650

Issue description

When One KinematicBody2D stands on another KinematicBody2D, on a side moving platform, they slide instead of moving with the platform. See the gif below:
Peek 10-06-2021 16-28
Sometimes it seems to work for a little time, and then they slide.

The expected result would be that both bodies move with the platform.
In Godot 3.2.3, the behaviour is the expected one.

Steps to reproduce

  1. Make a side way moving platform with a KinematicBody2D.
  2. Put two KinematicBodies2D, one on top of the other, on the platform.

Minimal reproduction project

KB2D_Platforms_Test.zip

@azagaya
Copy link
Contributor Author

azagaya commented Jun 10, 2021

So apparently REDUCING the safe margin makes this effect less noticeable.

@pouleyKetchoupp
Copy link
Contributor

Adding similar use cases for testing purpose so I can close duplicate issues:
#50407
#52061

@AttackButton
Copy link
Contributor

AttackButton commented Nov 29, 2021

It still happens in godot 4 alpha with CharacterBody2D. This happens even outside a moving platform (in a stationary platform), but somehow stop on slope fixes it completely, but doesn't fix it on a moving platform.

Without stacking, it works perfectly if just one or many CharacterBody2D are over the moving platform.

As collisions in version 4.x are in one direction only, to make the boxes to interact with each other you need to set layers and masks like: box: layer 1, mask 1.

*the platform below is an AnimatableBody2D with sync to physics == true.

godot_4_stacking_bug1

@AttackButton
Copy link
Contributor

AttackButton commented Feb 18, 2022

Godot4.:
Ok. Found out that it's only happens with CharacterBody2D and not with the RigidDynamicBody2D.

CharacterBody2D vs RigidDynacBody2D is a problem too.

In the mrp the red squares are CharacterBodies2D, the blue ones are RigidDynamicBodies2D. The left platform is a StaticBody2D, everything works ok there. In the right is a moving platform with CharacterBodies2D and RigidDynamicBodies2D interacting:

  1. The three RigidDynamicBodies2D interacting alone works ok, never enter in the platform.
  2. The CharacterBody2D enters in the moving platform if it is interacting with another CharacterBody2D or RigidDynamicBody2D.
  • A CharacterBody2D alone works ok with the moving platform.

rigiddynamic_vs_characterbodies_test

characterbody_physics_tests.zip

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

No branches or pull requests

4 participants