I'm trying to make a weapon pick-up system where the player walks in an area2d and then has the option to press F to pickup the weapon that he is currently standing over. The code looks like this:
weaponIndex = area.pickupIndex
weapon = WeaponContainer.get_child(weaponIndex)
The problem is that when I actually play the game and press the key(F), nothing happens. The signal works properly since the pickupText shows as it is supposed to. To test this out, I tried putting the same code in the _process(): function and there it actually detects when I press the action so it seems like the problem has something to do with the signal. Is it not possible to use Input statements in a signal? If so, how else can I do this?