Transferring Inventory

GAGE HOLSTON
24 Jan 2022, 02:50

I'm making a game where the player plays as three seperate characters at different points in the story. Here's what I need answered?

Character B served as a companion to Character A, who could store items with them to get around their own limited space. I used two different versions of Character B, one when he is an NPC to A and another for when he is the player character. I need a way to transfer the items stored in the NPC version to the player B upon the switch.


mrangel
24 Jan 2022, 08:54

You can probably use a script like:

foreach (object, GetDirectChildren (first_character)) {
  object.parent = second_character
}

(substituting in the actual names of the objects)