Group Collision between RigidBody2D and KinematicPlayer2D?

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

Hello, i’m having some trouble trying to make this work. I have a bullet scene and a character that shoots the bullet etc. The bullet is a RigidBody2D and the player shooting the bullet is a KinematicBody2D. Is there anyway to check if the instanced bullet has collided with an enemy (KinematicBody2D)?

I added the enemy to a group called “Enemy” Can I detect the collision from the RigidBody2D in groups? like in the KinematicBody2D you can detect collisions with is_in_group(“Enemy”)

Is there any way to do this with a RigidBody2D?

:bust_in_silhouette: Reply From: eons

You need to enable contact monitor and set the contacts reported “> 0”.

Then use get_colliding_bodies

Then you can operate with the array elements the same way as with KinematicBody2D.


Rigids also have body_enter and body_exit signals too to report contact.