Get node own child area2d when area_entered

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

i make test tree like:
…|_Slot (slotScript)
…|_area2d (listen area_entered)

func _on_item_slot_area_entered(area):
only give object : “item_area_2d” but i need “Item” object to assign temp_item = Item
how can i do it ?

func _on_item_slot_area_entered(area):

ramazan | 2022-03-05 07:44

ty for your answer. May be example above too simple to discription my situation.

im try drag “item” to “item_slot” (both have area2d) by 2 signal
1 item enter slot area
2 mouse is release

but “item_area” deep is different among others item and “item” name different too so i cant call multi times get_parent() because i dont know how deep “item_area” are.

each item are scene it self

i’m looking for solution help me determine which “item_area” parent without call get_parent or must know node name. Example above node “Item” is what i want

  • other small problem: how make text indent by tab in comment ?

RyuShai | 2022-03-05 15:15

:bust_in_silhouette: Reply From: RyuShai

i solve my problem by my self after few test (actually after many digging ).

area.owner extractly what i looking for