I have 2 scenes: the main scene and an Area2D scene. In my main scene I've created instances of the Area2D as shown below.
var k = area2D.instance()
for i in range (10):
var s = k.duplicate()
listplayers[i].setposition(Vector2((150 * i),357))
$Label.text = "one"
$Label.text = "two"
... and so on
My Area2D has the following code:
if event is InputEventMouseButton:
I've been stuck with this for a long time now, I've done a lot of googling but I'm still really confused. I've tried making script, sub-resources unique, didn't work.Every time I run the game, 'one' gets printed out 4 times (even though I've made 6 instances) no matter what I click on. I want the Area2D event to be run only when a certain event is clicked and the label to display corresponding text. What can I do? Please reply asap, this is urgent