Hello
We have a very confusing and annoying problem (UE 4.27.2) in one of our Blueprints where some actor component properties are seemingly reset to their default value upon cooking/packaging.
We have the following inheritance hierarchy:
- CppBaseActor inherits AActor
- BpParent is a Blueprint that inherits CppBaseActor
- BpParent has a MyWidget1 widget component which uses a Blueprint widget class
- in terms of geometry attachment, MyWidget1 is attached to the CapsuleComponent that is at the root of BpParent
- there’s also MyWidget2 that is similar
- the properties of MyWidget1 and MyWidget2 have been set, in the editor, to some specific values. For instance:
- Relative Location is set to (0,0,120) instead of the default (0,0,0)
- WidgetClass is set to WBP_Widget1
- DrawSize set to (1920,1080) instead of the default (500,500)
- BpAPlayer, BpBPlayer and BpCPlayer derive from BpParent
What happens is the following:
- We package the game.
- We perform a playtest.
- We then realize that one of the following three problems
has occured:- the properties of MyWidget1 have been reset to the default values:
- Relative Location is set to (0,0,0)
- WidgetClass is set to None
- DrawSize is set to (500,500)
- the same happens for MyWidget2
- no problem at all
- the properties of MyWidget1 have been reset to the default values:
The problem is during the packaging. Once a build is “tainted”, then the same problem occurs for this build whenever we play. By relaunching the build/packaging process, we can get a build without issues.
It happened once in the editor, for some reason: when this happened, we could clearly see that the component properties had been overwritten to the widget defaults: the yellow arrow that allows going back to the base values was displayed. The .uasset file was actually modified on-diosk with these bogus values (perhaps this was another problem with the same symptom, though)
The strange thing is that it ONLY happens for BpAPlayer and never for BPBplayer or BPCPlayer that are structurally similar. There’s no meaningful reason for this (BpAPlayer is the first one in the lexicographic order… loading order issue?)
I am a bit lost as where I could find the C++ code that deals with serialization during packaging and that would erroneously overrride the values with the default Widget Component values (that’s what it looks like anyway)
Thanks a lot in advance for any help or pointer on how to debug this!