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

**URL:** <https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296>\
**Category:** Programming & Scripting\
**Tags:** coding, unreal-engine, Blueprint, question\
**Created:** [October 8, 2025, 12:47pm UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296 "2025-10-08T12:47:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaanig03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaanig03](https://forums.unrealengine.com/u/Shaanig03)\
**Post date:** [October 8, 2025, 12:47pm UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/1 "2025-10-08T12:47:50Z")

</div>

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

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/9/059a157bf9f71dfbe513afe38e1ac55dd39f723c.png)

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/c/b1c6bb3f1eaf17da1153ad61b4afb16a13194009.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/3/c738370a89830612453411601c8e215857a5a02a.png)

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):

> [@Struct Data Resetting to Default Values on Editor Restart](https://forums.unrealengine.com/t/struct-data-resetting-to-default-values-on-editor-restart/1224863/2):
>
> UPDATE: The bug has been solved! I’ve managed to find a workaround to this bug and thought it’s worth sharing in case someone else runs into the same problem (since I’ve seen couple of posts that go way back regarding this issue). Here is what I did: I set the struct variable to not replicate and saved my project. If yours is not replicating, you may try to set it to replicate instead (for now, you can revert it later). I then closed the Editor. Upon reopening the editor again, I set …

More Info:

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

Platform: Windows 10 (22H2) [10.0.19045.6332] (x86\_64)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [October 8, 2025, 2:06pm UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/2 "2025-10-08T14:06:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shaanig03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaanig03](https://forums.unrealengine.com/u/Shaanig03)\
**Post date:** [October 8, 2025, 3:51pm UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/3 "2025-10-08T15:51:57Z")

</div>

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

blueprint function lib:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/a/bdaa58c7eff76f954974efd3457badab680590e0.png)

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 😕 , also lemme put my C++ class code here:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/b/90bfff419dc48c72b818c45eb1003497efb7c9c7.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/8/5f81e8e5aabdc5b38d908d53563b3f3e9ee309d9.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [October 9, 2025, 2:46am UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/4 "2025-10-09T02:46:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shaanig03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaanig03](https://forums.unrealengine.com/u/Shaanig03)\
**Post date:** [October 9, 2025, 3:04am UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/5 "2025-10-09T03:04:07Z")

</div>

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/b/04b3fb8cbdf3485a54b614242138aabc9b51eba4.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [October 9, 2025, 3:15am UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/6 "2025-10-09T03:15:13Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [October 9, 2025, 5:07am UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/7 "2025-10-09T05:07:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shaanig03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaanig03](https://forums.unrealengine.com/u/Shaanig03)\
**Post date:** [October 9, 2025, 9:03am UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/8 "2025-10-09T09:03:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shaanig03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaanig03](https://forums.unrealengine.com/u/Shaanig03)\
**Post date:** [October 9, 2025, 9:10am UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/9 "2025-10-09T09:10:29Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/d/6fd174c2ba90df275b103d2d66ca3ef8a4d016be.png)

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?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/d/28d9354069bb8c988d0757292a66a16d14bee905.png)

---

<div class="post-metadata">

**Author:** ![huarlhook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@huarlhook](https://forums.unrealengine.com/u/huarlhook)\
**Post date:** [January 15, 2026, 8:06pm UTC](https://forums.unrealengine.com/t/my-custom-c-object-class-invitemdata-resets-to-a-object-data-type-after-closing-and-re-opening-the-editor/2663296/10 "2026-01-15T20:06:48Z")

</div>

I have faced the same issue today and didn’t found the solution that would have helped me. So I figured it out for me and sharing it for everyone here and in a similar neighbor topic.

I’ve had wrong redirects in `DefaultEngine.ini` that prevented UE to load correctly:  
`+ActiveGameNameRedirects=(OldGameName=" _____",NewGameName="/Script/MyProject")`  
`+ActiveGameNameRedirects=(OldGameName="/Script/ _____",NewGameName="/Script/MyProject")`

The \_\_\_\_\_ thing is my current project name and MyProject is default name that didn’t exist anymore and made editor to try to load from inexistent config. Once I have deleted these lines the problem was solved
