+2 votes

Hello! I have a KinematicBody2D and a RigidBody2D. I need to check if the kinematicbody collides with the rigidbody but it is not working and I don't know why. The collision occurs but the code does not print anything.

Here is the code in the KinematicBody:
KinematicBody2D code

Here is the KinematicBody2D node parameters:
KinematicBody2D node parameters

Here is the KinematicBody2D collision shape:
KinematicBody2D collision shape

Here is the RigidBody2D node parameters:
RigidBody2D node parameters

Here is the RigidBody2D collision shape:
RigidBody2D collision shape

I tested another way to check the collision using RigidBody2D bodyentered signal and it is working fine, but I need to check the kinematicbody2d collision with the rigidbody using moveand_collide because I need to know if both collide in advance.

Here is the code:
RigidBody2D signal code

in Engine by (96 points)

I have something very similar but even the body entered signal won't work.
Everything work if I just change one of the two bodies to StaticBody2D.
Did you find a workaround?

The problem I had was not related to the code I posted here. In fact, there was another part of the code that was causing the problem. The people at Discord helped me to solve this.

1 Answer

0 votes

There was another code that was responsible for the problem.

by (96 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 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 webmaster@godotengine.org with your username.