Cook Error- Non Optional and Optional Objects

Currently, I am getting an error while compiling. It is related to me accessing some non-optional objects.
I have no clue how I did that and how to fix it.
Somebody mentioned that it was due to using UMaterialInterface* but removing it gave me the same error.
Any help on this would be much appreciated.

Error: Unreal Games/Paint Cube Game/Saved/Cooked/Windows/CubeMoveGame/Content/BP_GameMode.uasset: Non-optional object (/Game/BP_GameMode.Default__BP_GameMode_C) has a reference to optional object (/Game/Blueprints/BP_Player.Default__BP_Player_C:Material Red.Material RedEditorOnlyData). Only optional objects can refer to other optional objects.

[SOLVED]

In the script, I was referencing material as UMaterial*.
Changed them to UMaterialInterface* and then it compiled

1 Like

Greetings @BlackDash69

I was going to respond to work with the problem. But, it seems that you’ve resolved this. I’ll set it to solved/solution. If you have any more questions feel free to respond here. Thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.