I have the following component hierarchy that I manually dragged and dropped and created:
But at runtime it gets flattened for some reason, messing up interactions:
There’s nothing in the Blueprint other than these components, so there’s not much else for me to share to help the issue, it’s a plain Blueprint.
Except for a few settings:
StaticMesh 01 to 03 are set to not visible.
Capsule has custom physics settings.
Question
Why is it getting flattened? I even revised the Actor by diffing in the repository since its creation, and I can’t see that I have changed any other setting.
The project was migrated from UE4, so what I did was cloning it from the Git repository again to see whether it could be a caching issue, but the issue is really there.
Creating the blueprint from scratch, but now with a single mesh also flattens the hierarchy (there are no functions, nothing in the Event graph from me that could be doing this). The only change I made was activating Physics.
Runtime:
Without Simulate Physics it works.
UPDATE 2
When removing the scene root SceneComponent and making the Capsule Collider the root the hierarchy is not flattened.
But it doesn’t solve it for me, because I need to keep the hierarchy of Scene Component → Capsule Collider → Meshes.
But why is this happening ONLY HERE and it never happens everywhere else?
For example, this other Actor is fine and doesn’t get flattened.
Since the hierarchy gets flattened, if I attach the actor to another actor, only one of the components get attached, the rest stays floating in their current location in the world.
Did I find an engine bug?
I.e. if hierarchy is Scene Component → Capsule Collider (Simulate Physics: ON) → Static Mesh then this happens.
I still haven’t figured out why the flattening happens, and why for other Actors it doesn’t, like, the Character is never flattened at runtime:
(Is this topic turning into a devlog?)
But…:
Attaching and moving physics actors
In all of this, at least one big lesson so far. To attach physics actors/components to move them around, you must use a Physics Handle and attach to it (source).