#Assistance with Root objects holding destroyed scripts (Scene swaping)

1 messages · Page 1 of 1 (latest)

pure phoenix
#

Hello! Im making a game in unity and im completely stumped with making an inventory save load system.
I have a GUI panel named "PanelOnScroll" with a script called "GenerateInventorySlots" which is supposed to manage my attached GUI-objects "InventoryItemPanel"
When I change scene, the "PanelOnScroll" isnt root, so my attached script gets the error:

" DontDestroyOnLoad only works for root GameObjects or components on root GameObjects."

If I move my "GenerateInventorySlots" to a seperate Root gameobject, the script does not work.

a. Does anyone have a tutorial they know of that does a Json inventory saving system that persists between scenes
b. Does anyone know of a method of thinking that could help me debug my issue? I know a big part of scripting is knowing how to think differently and adapt.

I can totally provide more details : )

peak lichen
pure phoenix
#

I did not know this, thank you : )