I’ve been running into this problem since 4.7 and it’s driving me up the wall! I only work in Blueprint but still try to maintain programming good practices. So for every project I’ll create a custom base Character class that I will derive from for the _Player, _Enemy and etc. The problem is that sometimes without warning the Mesh component on these _Player and _Enemy children classes will completely lose their settings every time the editor is shut down and re-opened.
The worst part is I don’t know how to fix it, or even what causes it so I can avoid doing it in the future. It’s plagued me on literally every project I’ve done.
We’ve had this happen a few times with our characters as well, and it’s pretty annoying. What I ended up doing that seems to have fixed it for the time being is to recreate our child pawns by right clicking the parent and selecting create child from blueprint. Our other characters were originally made by duplicating, then setting the parent manually under Class Settings a while back, on 4.6. We didn’t have much functionality then, so it wasn’t a problem, and for a while we assumed it was something that broke when we upgraded from 4.7 to 4.8, as we jumped right onto the preview builds rather than wait for the official release.
Since recreating our blueprints this way the only time we’ve encountered the issue is when a parent class is updated and compiled, the child class gets updated, but is then reverted. A quick fix that worked for us, and may for you, is to make a change to the parent that requires it to be recompiled. When we did that the proper values propagated down to the children and both assets, once saved, retained those values on restart.
We had exactly the same issue in UE4.10, but I think we have found the reason. Apparently the mesh in the mesh component is reset in the child actor if it has set exactly the same mesh as in the parent. As soon as you set another mesh than in the parent, this setting is remembered even after editor restart.
Haimat’s suggestion worked for the character mesh issue. However, now the animation blueprint has been removed from children when the project is built.
Seems to be a blueprint fault by design that will stay. I believe it happens when UE crash and rebuild the project or when you change the parent or its dependency. Then UE is not sure how to deal with defaults and may reset child’s with parents default. You need to be careful when working with child, interface and function override. C++ is better on this.
This behavior is not an option, a work around on this is to not using “default override”, rather have an own child blueprint for each default setup and set the default values in constructor, begin play or some init function. You may hard code, read from a data table or database.
Create a thin player/enemy child blueprint for each default, instead of having one blueprint that you setting the default in the UE world instance. It may actually be better to set default by the blueprint rather by the UE. Then you can just drag n drop objects into the world without tamper with default every time. Yes, more files it will be, but its better then rework your default when the project starts to be big. Version management may save you if you see default loss in time.
Thanks for the comment Swe08. I’m not exactly sure how to reference all of the values from the child actor components parent and hand them off in the constructor but it’s definitely better than having to rework once the project starts getting bigger.