0 votes

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!

in Engine by (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.

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:

after colliding:

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.