GODOT 3.0 Collision between two RigidBody2d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FrogKnight

I am creating a breakout style game

I have a paddle that is a RigidBody2d in static mode it haves the body_entered(body) function

Also i have a powerup, it is the other RigidBody2d and it slides down but when it collides with the paddle the paddle doesnt detect that the body entered, it doesnt even detect other nodes

The layer mask are correct also.

:bust_in_silhouette: Reply From: HarryCourt

Place an Area2D node on the powerup. I presume you are using the 2D Editor, so I will be using that as my example. Using the “body entered” function, connect it by doing it in the inspector or use the line:

$Area2D.connect("body_entered", self, "bodyEntered")

Before you play the game, make sure you have made the player in a certain group. If this case, I will be using the group name “Player”.

Your function should look something like this (I will be using the code above):

func bodyEntered(body):
    if body.is_in_group() == "Player":
        # Do Code

Hello Thanks for answering

Yesterday i fixed it changing the player mode to “Kinematic” dont know why it worked

I will try doing what you tell me as they look like best practices, will tell you my results

FrogKnight | 2018-07-26 21:33