Optional Object Package/Cook Error

Hello,

I have a fairly small project that I am trying to package and I keep getting errors that some non-optional objects in my game have references to an optional object. The non-optional object that is causing the trouble seems to be the MaterialEditorOnlyData for a class I made named BP_SpherePiece. There error message I’m getting during cooking is:

Non-optional object has a reference to optional object (/Game/ThirdPerson/Blueprints/BP_SpherePiece.Default__BP_SpherePiece_C:Sphere Material.Sphere MaterialEditorOnlyData)

I would greatly appreciate some insight on this error and how to approach optional and non-optional objects in the future.

Thank You!

MaterialEditorOnlyData is a type of asset that stores information about a material’s appearance in the material editor, but is not used at runtime. In general, non-optional objects should not reference optional objects, as this can cause errors during cooking or packaging. One possible solution to this issue is to remove the reference to the optional object from the MaterialEditorOnlyData asset.