-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Kinematic bodies having collision normal problems against other Kinematic bodies. #24335
Comments
Happens on 3.1 as well. Can be worked around by checking if |
@bojidar-bg Thanks, that's definitely a more compact and easier method. Yeah, maybe a hack, but it's been my experience over the last year of using the physics that once things go beyond the platformer 101, things start falling apart like this. I still don't know enough yet to say which exactly are bugs, or if this is just something so dense with tradeoffs that it's always going to require some pile of hacks to get desirable results. I suspect though I'm not terribly off the mark in saying that there are things here and there that do not work fully as advertised. As long as the physics queries are reliable, works-arounds should be possible most the time. |
I've just tried the KinematicBody2D Demo on Godot 3.1.stable.official_x11.64 and I'm having a similar problem that I suspect is caused by the same bug. It appears when the returned vector of KinematicBody2D is {0,0} it won't integrate the forces of other bodies. This is evident when opening the KinematicBody2D project in 3.1 and standing on a horizontally-moving platform (in 3.0 you move with it, it 3.1 after your character stops moving and the platform briefly stops then you stop integrating it's movement). This can be illustrated by adding/removing a line of code before move_and_slide(..):
Obviously in a game where objects are moving across both axis you would need to do the same for linear_vel.y I've attached the demo project for reference (player.gd in particular): |
Looks a bit worse if they're also sticking to the walls. |
@pouleyKetchoupp I'm not entirely sure about this one. The logic seems simple enough that it should work, but maybe its not a valid way of dealing with KBodies. It does appear something has changed between 3.1 and 3.2 at some point. There is less stickiness between the circles, and more against the walls. Either way, I updated the MRP so it's more current with 3.2 |
I am also facing the same problem. In my case, the KinematicBody2D is moving in vertical direction from top to bottom. |
Godot version:
9c3293b
OS/device including version:
Win 10
Issue description:
The issue is that when trying to reflect kinematic bodies on collision, they sometimes stick to each other. This results also in sticking to walls.
It can be alleviated it somewhat by making temporarily exclusion between bodies for a few frames, which has a potential for worse side effects.
Steps to reproduce:
Use the MRP below or the following code.
Minimal reproduction project:
Kinematic Bodies Sticking.zip
The text was updated successfully, but these errors were encountered: