Kinematicbody won't detect a collision with a Rigidbody

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mark425
:warning: Old Version Published before Godot 3 was released.

I have a Rigidbody2D that is shot towards a KinematicBody2D using apply_impulse(Vector2(0,0),-get_global_transform().y*SPEED)
, the Kinematicbody2D has a script that contains:
if is_colliding(): print("Collision Detected") Rigidbody.queue_free()
When it collides for some reason it doesn’t detect the collision. How do I fix it?
Thanks in advance.

for what i got to understand with the Rigidbody2D if doesn’t really collide but uses a (assuming) lot of code to redirect the collision thus creating the feeling of bouncing on a wall or simply stopping, yet not colliding

rustyStriker | 2017-11-12 21:39

:bust_in_silhouette: Reply From: eons

Kinematic bodies normally do not detect collisions (here and in other engines), collision detection is only triggered by the move api, if you need to use is_colliding, use move first.

If the kinematic body won’t move you can use the rigid body to pass the collision with a signal using body_enter (enable monitoring and increase the contact number for this to work).
So in the rigid’s body enter, check the body parameter, if is the kinematic body you want (group or class check) use a function on the kinematic script to do something with that information.

Other option is to connect the rigid to the kinematic directly but the usefulness of that depends on the design.

And in some cases you can just add an area to the body to detect others.