0 votes

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 isingroup("Enemy")

Is there any way to do this with a RigidBody2D?

in Engine by (23 points)

1 Answer

0 votes

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.

by (7,908 points)
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.