[Bug?] Can't detach object from hierarchy at runtime

I tried SetParent(null) and parent = null, and neither works.
I have an object in a prefab that I want to set DontDestroyOnLoad for, but it needs to be at the root.
I’m guessing that setting a parent to null should be disabled in prefab isolation mode as only one element can be at the root, but at run-time this should be allowed.

EDIT: I’m starting to feel like this is a bigger problem, not just being unable to set parent to null, but to anything. However, it’s not happening all the time and I can’t figure out what’s different.

1 Like

Good catch. I am using DontDestroyOnLoad in actual project, and considering moving to Nested Prefabs for other benefits… this is a good warning. Thank you!

Wait, am i getting this good, are you telling us that you cannot detached the nested prefab child object from the parent on runtime?

We are not aware of any problem like you describe. Can you submit a bug report with repro project and repro steps? Thanks.

I’m busy trying to get our project finished at the moment, and I’m not sure how easy it will be to reproduce in isolation. The thing is, tons of things might have been fixed already in your internal build.