Hello there! Can you help me, please?
I am trying to make possible for player to select an enemy in my 2D top-down game. Once the target is selected, the player should get its name. I've tried whats on the pictures below.
Everything is instanced in-game.
Used variables are:
- cursorarea = Area2D node with child node RectangleShape2D called cursorshape
- possibletargets = an empty array
- targetnameplate = Label node
In settarget() func, the rest of the line not shown on the picture is just the globalposition of the cursor_area.
Now the thing is, it seems I can't get the name of the target. print(targetname) is not printing anything and the targetnameplate is also showing nothing.