Why is my collision not interracting?

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

This is the main scene
Instanced Node

My problem:

When the player character (red godot logo) collides with another Godot logo, it must print something in the output console. But the problem is, nothing is happening… I don’t understand why.

Area2D Body-Enters event/signal code:

extends Area2D

func _ready():
    print("Area2D ready")

func _on_Area2D_body_enter( body ):
    print("yo! Interacting!") #<-- this code is not getting executed when colliding

Godot project: https://drive.google.com/file/d/1sVC7l2V2UjMBvwzhEHSedkpI98jgoB6I/view?usp=sharing

:bust_in_silhouette: Reply From: hilfazer

You need to connect signal area_enter. It detects intersections with areas that have collision shape (as their direct child).

body_enter detects collision with PhysicsBodies that have collision shape.

Wow… thanks man! I was 2 days busy with it… just couldn’t figure it how it worked.

Qws | 2018-02-18 19:46