0 votes

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
- target
nameplate = 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.

enter image description here
enter image description here

asked May 29, 2018 in Engine by IranosMorloy (59 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.