It won't work because collision detection wont be updated on the inner kinematic body (is not a joint but 2 separate bodies, one moving, the other dragged by the parent), you can add an Area2D instead and simulate a collision with area_enter
signal or get_overlapping_areas
.
But I think that will work better if the small body is the parent kinematic and the bigger is an area (or a set of raycasts).
And there is a way to "move" 2 bodies at once but is kind of hacky:
Put the children inside a plain Node
, the children of Node will not be affected by parent's transformations.
KinematicBody2D
|-Sprite
|-CollisionPolygon2D
|-Node
|-KinematicBody2D
|-CollisionPolygon2D
Then, when you move
the body in the script, you will need to move
"Node/KinematicBody2D" too, and check both for collision.
I don't like it, it could get messy in some cases, but may work.