ScriptableObject vs DontDestroyOnLoad

I updated to Unity 5.3 and since that I’m receiving the following warning for all the ScriptableObject.DontDestroyOnLoad(instance) calls where the instance parameter is a ScriptableObject created simply by ScriptableObject.CreateInstance();

Warning: DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.

Is there any easy solution for it? Or should I modify all such ScriptableObjects to MonoBehaviours and assign them to a root GameObject?

@Zbleka
ScriptableObjects are not Components like Monobehaviors and thus are not intended to be attached to a gameobject. They aren’t designed to exist in a scene like a Component or gameobject. they’re meant to sit out of a scene and store data that can be used and persisted across an entire project.

that said it doesn’t make sense to call Don’tDestroyOnLoad on them since they shouldn’t be in a scene in the first place (A component script might reference them, but the asset itself is never in a scene), they not unloaded in the same manner as gameobjects and components.

Essentially this means you shouldn’t worry about calling DontDestroyOnload since they’ll persist across levels regardless.

@JoshuaMcKenzie Well, everything you said (wrote) sounds so reasonable. But part of the question still remains opened: Why it was not complaining before?

Anyway, I understand your point of view which is a clean concept. But I’m afraid the reality was little bit different in the past. Now it seems to work as you said.

I’ve removed all of ScriptableObject.DontDestroyOnLoad() calls and it seems it does not have any negative impact to the project at the first glance. But I have to perform some more tests to be sure.

Thank you