Bug in UFastGeoWorldPartitionRuntimeCellTransformer::Transform() leads to an assert about component attachments and components being detached from their root.

I believe the code should be:

						Component->AttachToComponent(NewRootComponent, FAttachmentTransformRules::KeepWorldTransform);
						//Component->SetupAttachment(NewRootComponent);

Thanks for any help you can provide

[Attachment Removed]

Steps to Reproduce
Run the FastGeoWorldPartitionRuntimeCellTransformer on actors where bIsActorFullyTransformed will be false on the actor.

This will run Component->SetupAttachment(NewRootComponent) which will lead to this assert failing, and then the component not attached.

if (ensureMsgf(AttachParent == nullptr || !AttachParent->AttachChildren.Contains(this), TEXT("SetupAttachment cannot be used once a component has already had AttachTo used to connect it to a parent. %s is already attached to %s"), *GetFullName(), *AttachParent->GetFullName()))



[Attachment Removed]

To add to this, we have another transformer that called: AttachToComponent()

Is that not supported?

[Attachment Removed]

Hello!

Do you have more details on the Actor being transformed when the ensure fires? I am trying to reproduce here and I haven’t been able so far. From what I see, the Component would need to be Registered for the ensure to fire. Could it be related to the change discussed in that thread? [Content removed]

We have recently implemented a fix that is a bit different than what was proposed at the time. The CL is 52954528. It only reruns the Construction Script if the world is initialized. That was sufficient to address the repro project we had.

Martin

[Attachment Removed]

I dug into this a bit more, we had a previous transformer that was calling AttachToComponent() instead of SetupAttachment() which led to the situation of the assert. I fixed that other transformer and now it works, but maybe there is a way attachment setup could be enforced in the transformers better, not sure.

I think the construction scripts are part of the issue, but we have worked through those with some cherry picks and custom code. We have an absolute hack job to fix the construction script issue by setting the actors to bActorSeamlessTraveled = true :sweat_smile:

I will take a look at that CL you posted, it might be better

[Attachment Removed]