0 votes

Hi,
I'm using KinematicBody2D to collide with several other KinematicBody2D and StaticBody2D. The problem is when the object collides with one object, be it other kinematic or static, it won't register another collides from other objects.

I'm moving kinematic with moveandslide() and using getslidecount() together with getslidecollision() to get the collisions (which I assume a way to get all the collision happens to this kinematic)

for i in get_slide_count():
    var collision = get_slide_collision(i)
    print("Collided with: ", collision.collider.name)

The result is getslidecount() never returns a value greater than 1 (either return 0 or 1) even when all the objects hitting each other.

I tried to search for a way a KinematicBody2D to get all the collisions that happen but there's no specific tutorial for this, all that I find just collide and done

Is my assumption is wrong, or is there another class that handles kinematic collision?
a link or a pointer to solve or discussing my problem is much appreciated!

asked Nov 6, 2019 in Engine by Langrisser (12 points)

According to the documentation, it will only register collisions with RigidBody2D and other KineticBody2Ds, not StaticBody2D. I'm not sure if that will help or not, but if is colliding with StaticBody2D nodes and you're not getting anything back for it, that might be why.

Hi,
I tried to collide it with other KinematicBody2D but still, getslidecount() only return 1 when visually it should hit 2 other kinematics.

I'm starting to think it's a bug...

before colliding
after colliding

before colliding:
https://imgur.com/Jmvh7GR

after colliding:
https://imgur.com/oFGrpsI

The white number on top is get_slide_count() value

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.