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

RigidBody2D and moving platforms #40495

Open
Tracked by #45334
luccapedrini opened this issue Jul 18, 2020 · 5 comments
Open
Tracked by #45334

RigidBody2D and moving platforms #40495

luccapedrini opened this issue Jul 18, 2020 · 5 comments

Comments

@luccapedrini
Copy link

luccapedrini commented Jul 18, 2020

Godot version:
Godot 3.2.2 (also tested in 3.2.1)

OS/device including version:
Windows 10 (Tested with both 2D physics engines)

Issue description:
I'm trying to make a 2D platformer that is very physics dependent (so I need to use a RigidBody2D), when the player jumps I use apply_central_impulse() and the player loses control until it hits the ground again.

All of this mentioned above works almost perfectly, but when the player interacts with other moving bodies (Kinematic or Rigid) this happens:
https://imgur.com/a/dHyNUxr
**Bugsquad Edit: ** Added 10s clips of the videos in the link
Up-Down-Trimmed
Left-Right-Trimmed

I'm using the template project so it's easy to reproduce, but you can go ahead and test with any changed configuration and it still gives somewhat the same behavior.

Steps to reproduce:
RigidBody2D on top of any moving Body.

Minimal reproduction project:
Not gonna upload the project since it's an official template,

Template name: 2D Physics Platformer Demo (RigidBody)
Version: 3.2.2

@luccapedrini
Copy link
Author

luccapedrini commented Jul 18, 2020

I would like to use this issue to raise up some questions about the topic above. (please mark as off-topic if this isn't the place to talk about this)

1. Is the problem with tilemaps liked above worth an issue (didn't post since it looks like is an known one)

2. RigidBody2D in Kinematic Mode is bugged, or bad documented
The way i'm solving the issue above is, I'm instantiating and queue_free()ing a RigidBody2D and KinematicBody2D as needed. This would be an way easier task (and a cleaner code) if the Kinematic Mode worked as a KinematicBody2D. I don't know why thats not the case but if you search online there are a number of people noticing the same.

3. Why isn't Godot focused on getting the 2D physics right?
Edited: as liked by Calinou this topic is being discussed in another issue. I want to reiterate that I never demanded anything and as I said I understand that godot is an open-source project, I was just asking about the priority decision that is being presented to the community.

@Calinou
Copy link
Member

Calinou commented Jul 18, 2020

  1. Why isn't Godot focused on getting the 2D physics right?

Please understand that Godot is community-developed. Most features are maintained on a best-effort basis; there is no warranty provided whatsoever. Still, physics will be refactored in 4.0 (godotengine/godot-proposals#570).

@madmiraal
Copy link
Contributor

when the player interacts with other moving bodies (Kinematic or Rigid) this happens:

@luccapedrini I've looked at the linked videos and I can't see anything that is happening that shouldn't be happening. Please be more specific.

@luccapedrini
Copy link
Author

@madmiraal
The player's collision shape going inside the platform on the first gif.
And on the second one the player sliding as the platform move.
I don't think I can explain any better than the videos, for me it looks pretty obvious that there's something unexpected happening but I don't know where exactly the problem happens in this situation if that's what you're asking.

@madmiraal madmiraal added the bug label Aug 5, 2020
@madmiraal
Copy link
Contributor

When the platform is moving left-to-right the RigidBody is relying on friction to provide a force; so some degree of sliding due to inertia is expected. Related to #16450

When the platform is moving up-and-down, there is a delay between the RigidBody responding to the movement of the platform, because the RigidBody updates and the platform updates happen at different times. So, I'm not sure whether or not this is fixable. Related to #27652

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

3 participants