Hello, I have included a repro which shows a problem where if you have an IsEditorOnlyActor parent and you then cook, then the children get offset from origin, instead of where the parent was during the cook. If you run it in PIE you see that the children stay at the place you expect them to be in the world, and it’s just the parent that gets removed and the children stay in place.
I would expect that the children should behave the same in a cook, so they should not get teleported to origin and rather stay in the location they were placed in.
For additional context:
In our project this issue is essentially random in the cook. So sometimes the children appear in the correct place after the cook, and other times they show up at origin. So for larger projects there seems to be some race condition involved, for whatever reason. However for this minimal repro it seems to reproduce on every single cook.
I have reproduced this issue in our custom 5.4 & 5.5.4 editor, as well as “vanilla” 5.5.4 and 5.6.1 and it behaves identically in all of them (children get moved to origin in a cook).
Our own investigations showed that we could work around this issue by making sure the children get detached during the cook and that they inherit the world transform from the parent. For example by modifying AActor::ClearCrossLevelReferences(), and ensuring it calls DetachFromComponent for the children with KeepWorldTransform. I doubt that is the correct fix however.
For now we are currently not setting the parent as IsEditorOnlyActor to ensure that the cooked location is deterministic, but that is just a temporary workaround and causes problems in other areas of the project, so we do need some way of fixing this before it is time to ship.
Thanks