ScriptableObject constructor changed?

I am New to ScriptableObject constructor i am using a scripts from my friend which work perfectly on 5.3
where as it gives below error for 5.4.0b21 - 5.4.0b25

Is there anything that i am missing or being changed from 5.3 to 5.4

“LoadAssetAtPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead.”

ScriptableObjects as well as MonoBehaviours are created internally by Unity. You shouldn’t do anthing that uses the UnityAPI inside the constructor since it might be called from Unity’s background loading thread. As the error suggests you should to initialization inside the OnEnable callback.

If you create ScriptableObjects manually you have to use the CreateInstance method. You must not use the “new” keyword.

Also note that Resources.LoadAssetAtPath is now deprecated and you have to use AssetDatabase.LoadAssetAtPath instead. Also this method only works inside the editor, so your scriptable object might not be used at runtime unless you wrapped the editor functionality in preprocessor tags.