-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 collision detection occurs depending on movement of it and the collider #46513
Comments
In general, it would be much safer to detect collision from both kinematic bodies, because About the specific scenarios: In 3.2.4 RC3, all stationary cases detect collision (which is more consistent), although I'm not sure this should be the expected behavior since they don't technically bump into anything. For the (-15, 0) case: For the (0, -10) case: |
first of all thanks for you answer :)
yeah i'm just looking for consistency. i can somewhat accept if move_and_collide doesn't detect passive collisions but then i would expect it for all of them. if what you wrote about 3.2.4 is gonna be in the next stable though its just gonna be even less consistent... a) only detect active collisions (meaning when bumping into something) and it shouldn't matter if its moving away from it if its gonna stay the old or some other way i think it would be a good idea to document its behavior in some way. also the bottom left case really freaked me out, where the outcome is really just decided by the x position of the detector being a multiple of 5 or not ~ |
In 3.2.4, since all stationary cases detect collision, it will be a bit more consistent as the edge case in the bottom left is not happening anymore. a) would be probably the way to go to make everything consistent though, as b) would be difficult to do without breaking the current API in other scenarios. In any case, your best shot for consistency is really to detect collision from both |
i agree :)
yeah thats what i'm gonna do, thx should this issue remain open until something is done or how do we manage this stuff? |
Yeah, it can stay open until things are made more consistent. |
alrighty thanks again! |
Closing as the inconsistent cases are fixed in 3.4 beta 6. The only remaining case that doesn't detect collision is (-15, 0), which is the expected behavior. |
Godot version:
3.2.3 stable
OS/device including version:
xubuntu 20.04
Issue description:
KinematicBody2D only detects collisions from all sides when stationary(and not even that in some cases)
when moving it only detects collisions from the direction its moving towards even though there is no oneway collision enabled.
the project in the video is the same as the reproduction project attached below.
the "collision detectors" should all disappear when colliding with the "actors"
they all have identical code meaning they should all detect collisions the same way and "queue_free()" themselves
collision_test.mp4
Steps to reproduce:
Minimal reproduction project:
no sprites, so enable [ Debug > Visible Collision Shapes ]
collision_test.zip
The text was updated successfully, but these errors were encountered: