My custom C++ object class 'InvItemData' resets to a 'Object' data type after closing and re-opening the editor

My struct variable (object reference) to a custom C++ object class

image

whenever I close and re-open the editor, the variable’s data type is changed to a object?, this happens not only in the struct but other places like in my function library too

after re-opening UE (struct & function library):

image

I can change the struct back to my custom c++ object data type however I get a series of errors which doesn’t go away until I delete the’ ‘Item Data’ variable and compile, it fixes the issue and if I undo and compile it works and my item data is restored? O_o

is this a bug? (because of similar topics):

More Info:

UE Version: 5.6.1-44394996+++UE5+Release-5.6

Platform: Windows 10 (22H2) [10.0.19045.6332] (x86_64)

Do you get errors like ‘Blueprint could not be loaded because it derives from an invalid class’

nope no error like that, also should have included the errors

blueprint function lib:

also weird, this time only the blueprint function library throwed a error, b4 I got some errors in my inventory component but now I don’t when I re-opened UE?

now the BFL error is thrown because the function’s input ‘Item Data’ variable data type was changed to object type, so I’m not sure what’s going on :confused: , also lemme put my C++ class code here:

is this a c++ project or a BP one with added c++ because i find that to be buggy

also try reloading the class with the bad references in editor, not a good solution but tells you the problem is likely a load order

it’s a BP project with C++ later added

I tried through IDE cleaning the solution, rebuilding it, also by reloading the class do you mean rebuild?, I’m not sure I come from Unity so I’m not that experienced with UE yet

by right clicking my class I’m not seeing a reload option, by editor do u mean the UE editor or the IDE?, srry if I’m being a little stupid xd

no for instance reload the BFL

if you’re not too far in i’d recommend restarting with a c++ project. (you can migrate your files)

what i think happens is the BFL loads before the c++ file which causes your class to not be loaded so it defaults to the base class (UObject)

Have you tried deleting the Binaries and Intermediate folders, then opening VS and rebuilding the project?

this didn’t work, I don’t think its a issue with BFL since the struct’s variable is being changed to an object

P.S: by struct I mean the created struct in the content browser not a local variable but the struct asset itself

I tried this, deleted the two folders and in VS selected ‘Development Editor’ for solution configurations like that topic mentioned, clean and rebuilded, then opened UE but it still says I need to build through IDE?

image

also noticed the binaries folder isn’t created when I rebuild, am I doing something wrong here because I’m pretty sure I saw a topic someone doing this and got it working 4 him

also my Engine/UE5 and Games/MyGameName isn’t found after deleting those two folders?