Programmatically spawned GeometryCollection has no physics?

I haven’t tried this, but someone from the Unreal Slackers Discord said he had success with this:

UGeometryCollectionComponent* TargetDMComp;
            TargetDMComp = Cast<UGeometryCollectionComponent>(AddComponentByClass(UGeometryCollectionComponent::StaticClass(), false, TargetSMComp->GetRelativeTransform(), true));
            TargetDMComp->SetRestCollection(*FoundCollection);
            FinishAddComponent(TargetDMComp, false, TargetSMComp->GetRelativeTransform());
            TargetDMComp->SetRestCollection(*FoundCollection);
            TargetDMComp->EditRestCollection(GeometryCollection::EEditUpdate::RestPhysicsDynamic, false);

I’d like to also state that doing any kind of stress to geometry collection in UE4.27 Chaos will result in crashes and it renders using it impossible. Hopefully UE5 doesn’t have these crashes.

1 Like