How Can Storage Be Done If Unity Deletes Or Duplicates Gameobjects?
Hello so basically my game is going to need a storage not for items but for characters think summoners war type thing, Anyway if i change scene the object is deleted even if add'd to the storage list first , So to combat this i use dontdestroyonload but then it starts duplicating the gameobject every time the scene is changed so i use if(findobjectsoftype(getttype)().length > 1) etc so it deletes duplicates but that is also a problem because if the player gets a duplicate character it will delete it, I don't know how unity wants me to store gameobjects in to a list and were the gameobject can be deleted but remain in the list so i can have the player take it from storage and add to storage. Example below.
//Ok so im giving a rough idea here no proper caps etc
//Basically i want this
list<GameObject> storage = new list<GameObject>();
//Ok so above should have the characters not being used they should also not be visible as a full character in game unless the player takes it out of storage. now the problem is if i summon / instantiate a character and add it to the above how do i remove the object from the scene but keep it in the list above?
//if i do this
Destroy(summonedmonster);
//It destroys it from the list, i need to keep it in the list but physically be destroyed also i don't wanna use setactive(false) because its kinda bad to use for this and weird and buggy things are likely plus it will duplicate between scenes or destroy duplicates taking me back to square one.
ok so thats it i just want a gameobject to remain in a list but i need to destroy the summoned version of the object because i only want one character to be seen / instantiated at one time thanks any help is appreciated.