i tried it and final after searching a loot i couldn’t find any answer to it …
i have a game object that contains a canvas, in that canvas i have inventory and i am dynamically adding items in to it so when ever i dynamically add new item it wont get parented to the slots and if i make the canvas not a part of DontDestroyOnLoad object then it works fine. i don’t know what i am doing wrong but please help… !
Normally, if your canvas is part of the Dontdestroyonload, it will be not destructible.
If you are not sure about how you can access your game object, I recommend to use GameObjet.FindObjectWithTag(“MyCanvasTag”); and a specific tag. Like this, you can access your canvas from every scene because the canvas is still a part of the scene.
You have to parent your item to your canvas too. Be sure you really place your inventory in the canvas. Maybe creating a panel to access it easily ? Depending on what you want.
The last thing you can do is to call the function DontDestoryOnLoad(MyInventory"); when you have instanciated your object.