Constructing C++ object class fails to package

Made a C++ object class. Inside a bp I construct it ( construct object from class) works fine in editor, fails to package.

If I make a child class of said object class as a bp, I can construct that build fine.

Is this the proper workflow? Or am I missing something cause this doesnt feel right to me

Hi there :blush:

Do you have the package error?

Also, it is common for a C++ class to be reflected into a blueprint class. Can you please share how you were creating the blueprint class?

Also, this should be the latest documentation: CPP and Blueprints Example | Unreal Engine 5.2 Documentation

heys

unfortunately no package error as it magically works now. I guess some kinda mess up with live coding compiling and building. Having restarted the editor and compiled the code outside I guess cleaned it up ( or at least I hope so cause I hate mystery didn’t work and now just works)

For clarity I made the object class in c++ set to blueprintable and what not so I could access it from bps and for the “fix” click, new bp, search for the class type created ( since without blueprintable you cant make child class like that )

I get that its common practice to make BP versions of C++ classes, but more so what I was curious / concerned about was having a bp being able to spawn c++ classes. Nothing seemed to suggest other wise so I was thrown when I got the packaging error.

Inside my actor bp I was using construct object from class, and selecting the C++ class from there.

The error was something along the lines of cannot construct object class “x” inside of actor class “y”

1 Like

Glad it’s working now :smiley: and huh, I have not tried that kind of spawn before. Perhaps it’s not supported?

never trust the compile button in editor

1 Like