-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 passes through walls/objects when pushed by a KinematicBody2D #27652
Comments
Similar experiences, and with CCD enabled they can still tunnel. |
Happens to me on my 3D game project also. |
Is there a possibility this will be fixed soon (in 3.1.1, perhaps)? The Rigid Bodies are basically unusable because of this and 3.2 won't come out for quite some time probably. |
My objective: to prevent a RigidBody (or KinematicBody) from "crossing" the StaticBody (like a wall or floor). I have a script that "pushes" a RigidBody (Cube) with the mouse. And I connected a In my understanding, the |
Body_entered fires every time the other body is entered. I don't know what the resolution of the check is, why it detects so late. Check not only for body_entered, but also for a boolean of your own creation. |
I'm here to confirm that this also happened to me in a simple 2D project I was implementing. A KinematicBody2D pushes the RigidBody2D through walls and floors as if it were nothing. |
Not too likely. I wish I could say otherwise, but personally I have benched these for most uses since 2.1, and over the previous year I have the impression it is an area that lacks contribution. Juan may dabble a bit in the 2D physics here and there to patch things up, and it is something he talks of fully rewriting, but it has been bumped to the next version with each stable release. He may be the only one currently that can take the job on, but I imagine his priorities are necessarily between things like rendering work and general maintenance. |
This comment has been minimized.
This comment has been minimized.
Maybe this hopefully could resolved the problem ? #27415 |
This seems not physics related as does not happen with normal Bullet physics objects with separate project. I think a problem is due to infinite inertia and other stuff related to KinematicBody. It is very hard to implement collision so that it prevents Kinematic-Rigid collisions as it hits RigidBody with inadequate momentum. Would be nice if it was possible to avoid collisions completely (consider RigidBody a wall) or be able to override momentum or mass and force for Kinematic-Rigid collision. |
I think there is a need for tutorial for dynamic character controller based on RigidBody as for other engines, this will make collisions much more natural. Dunno how to merge that with root motion but as NaughtyDog did that I think everybody else can do it too. |
@slapin At least for 2D, one isn't going to have much success at creating a stable and reliable dynamic body character of any complexity with the presently outstanding issues. I'm not sure what the state of affairs is for 3D. |
Same here #27593 |
Turns out the problem is with infinite_inertia value which was introduced as an addditional parameter in move_and_slide function in 3.1. In order to fix the issue, you need to set it to false and then write code that will move rigid bodies on collision with the kinematic. I wish someone announced that there was a new parameter added :/ It would save some of us a lot of confusion. Edit: Also, I believe this parameter should be set to false by default in the next releases. |
I also saw this video @rdmtt ! I always thought this infinite inertia aspect of Godot's Kinematic Bodies had something to do with this weird behavior, but I never got to investigating it further! KidsCanCode rocks! |
This is indeed not a bug but a configuration option as pointed out by #27652 (comment). This API has been improved significantly in 4.0 IIRC, so this might be less confusing now. |
Godot version:
3.1
Issue description:
Rigid Bodies pass through walls when pushed by Kinematic Bodies. This doesn't happen in 3.0.6.
In 3.0.6: https://i.imgur.com/k7vJdoM.mp4
In 3.1: https://i.imgur.com/BhkKt0G.mp4
It doesn't just happen in the platformer demo, I noticed this problem in other projects as well.
The text was updated successfully, but these errors were encountered: