If I have a weapon or item attached to a character/sprite and the sprite gets destroyed how do I destroy the item?
Picking nearest seems to cause problems, and if hitting object or overlapping object wont work because it could be overlapping another sprites item who isn't destroyed.
You see my conundrum?
What method do you guys use?
Since the weapon is a separate sprite and its "link" to a specific character, you can store the Character.UID in the item as a variable. So when your Item or Character gets destroyed. You can pick both the Item or Character based on this:
The two items:
Character_UID = 100 (Stored character UID)
UID = 100
When Item is destroyed:
Item on destroyed
Pick Character.UID = Item.Character_UID
When Character is destroyed:
Character on destroyed
Pick Item.Character_UID = Character.UID