
I'm trying to do a pickup item script, but it's not working. What happens is, when the player.weapon is null, the code works fine. When the player already has a weapon, the first time it works fine, but the next time I try to switch the weapons, the weapon.instance() returns null. What can I do to fix this?
(weapon gets a load of the weapon scene on a _ready() function)