![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Sir_Skurpsalot |
Trying to start an inventory system, and get an object to add itself as a child to another object when picked up by the player, but body.add_child(self) doesn’t seem to work. I don’t get any errors but nothing happens.
func trigger_body_entered(body):
if body.has_method("pickUp_Weapon"):
if body.weapons[1] == "Empty":
print ("Picked up " + weaponName)
body.weapons[1] = weaponName
body.add_child(self)
pickUp = false
else:
print ("Already have " + weaponName)