Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

Objects remain under DontDestroyOnLoad despite being removed from the parent

$
0
0
I'm trying to upgrade a project from Unity 4.6 to 5.4 and I'm having an issue with objects not being removed when loading a new scene. I have a root game object which contains the player, camera, game manager, etc. and I use DontDestroyOnLoad to keep it when loading scenes. The player is able to pick up and drop/throw objects, which I do by parenting/unparenting the object to the player. But when I set an object's parent to null, the object stays under DontDestroyOnLoad in the hierarchy, so they remain after loading the next scene. I can see that Unity 5.4 shows the scene and DontDestroyOnLoad as two root items in the hierarchy, unlike 4.6. Is there a way to detach the child objects from the player and remove them from DontDestroyOnLoad? Do I actually need to parent them to some other root object?

Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>