overlaps and instance

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

Hi, actually I have a node that has many enemies as children, when i want the character detects an area or shape that belongs to the enemy, works but i notices that i used the absolute path to do this and if i put more enemies in escene, just detects 1 of them, how can I do to make the player detect all the enemies as the same, i dont know if i have to use arrays but when I tried the error message says that cannot conver string array into object.

I hope you can give me some hints

Did you set a number higher than 1 at XXXBody(2D) > Contacts Reported of the character?

volzhs | 2016-05-17 19:17

I will be more specific, there is an area 2d that is child of a rigidbody(player), i want this area detects when another area is overlaping, the area i want to detect is child of the enemy, when i load the escene all works, but when i add more enemies just detect the area of the first one, i use the string "/root/… as the path to detect the enemy area, I know that I cant use absolute path because just recognizes 1 of the nodes, I need that works on all the nodes(enemy) how to load al the duplicated nodes to be detected as the same one

Themaker482 | 2016-05-17 19:36

:bust_in_silhouette: Reply From: Themaker482

I will be more specific, there is an area 2d that is child of a rigidbody(player), i want this area detects when another area is overlaping, the area i want to detect is child of the enemy, when i load the escene all works, but when i add more enemies just detect the area of the first one, i use the string "/root/… as the path to detect the enemy area, I know that I cant use absolute path because just recognizes 1 of the nodes, I need that works on all the nodes(enemy) how to load al the duplicated nodes to be detected as the same one