[C++] Actor Component variables Reset when restarting Editor
Hi! I have an issue where my Actor Component that i made in c++ gets its variables reset to their default values when the component is implemented into a actor BP and i restart the editor.
As you can see in the pic, the bools on the right are at their default values which set in the .h, if i where to change them in the BP, close the editor and start it back up, they would be back to their default values again.
How can i make changes that i make to the actor component permanent and get saved?
asked May 22 '19 at 12:03 AM in C++ Programming
Ok figured it out. It happens when i add a Event Dispatch Delegate with:
Then in the class .h:
After adding a delegate, it won't save unless i delete and re-add the component in the list, then it works as intended. So after every delegate changed/added you have to re-add the comopnent in the list.
answered May 22 '19 at 07:40 AM
This is sadly a common issue with hotreload and could even affect your game in ways that would make it crash, I used to experience some very strange bugs because of it too (by having static mesh subclasses loose their blueprint selected meshes)
What I suggest you is one of the following:
I really hope some of these strange hot reload issues get fixed...
answered May 22 '19 at 03:45 AM
The strange thing is the engine doesnt even inquire me to save after a made any change to the actor comopnents values, like it doesnt even count it as a part of the BP.
Is there anything basic you have to do for it to "register" as a comp?
Yea having nodes in the constructino script would fix it if have BP variables, but i would like the component to be able to be places on static mesh actors that is not a BP and work as well, with no other code required for it to work.
answered May 22 '19 at 07:16 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here