Hello,
I have the following problem in my project. This always has been a sporadic issue, starting in 5.1.1 several years ago, and continuing now, to 5.5. I haven’t been able to figure out what is going on and have spent considerable time working around it. This is a description of the problem:
Each building has a parent object, an instance of “BP_Building.”
The children of that object are instances of “BP_BuildingPart_Mesh” – visible components of the building, with a static mesh, and some other properties for building comprehension.
BP_Building derives directly from Actor
BP_BuildingPart_Mesh derives directly from Actor
I have the following problems:
- The Mobility value of static components within BP_BuildingPart_Mesh objects randomly becomes Movable, causing them to be disconnected from the building object and moved to world 0,0,0. I made a function on the BP_Building object which assigns the Mobility - Static property to all children recursively, and this still continues to happen. For complex buildings with precisely placed parts, this is very annoying.
- I have a function on the BP_Building object which recursively adds each attached BP_BuildingPart_Mesh to a list within the parent BP_Building, and at the same time, adds a reference to the BP_Building to each attached BP_BuildingPart_Mesh – building a bidirectional relationship between the parent and children, since the actual attachment is unreliable (problem #1). On some buildings, this works. On others, like the building shown above, the children lose the reference to the parent when Unreal Editor is closed and re-opened, or HLODs are deleted or rebuilt. If the child’s reference to the parent is manually assigned, it seems to hold, but this is not feasible as buildings have thousands of components.
Does anyone have any idea of what is causing this behavior?