Hi there,
I have a problem by scale a Actor with an Geometry Collection in it. All times a Second Actor with an Static Mesh as Component overlap with these Actor, the Unreal Crashes with this Code:
Assertion failed: StaticType() == Obj.GetType() [File:D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\ImplicitObjectScaled.h] [Line: 523]
I´m init the GC in the constructor like this:
ACTreeFoliageBase::ACTreeFoliageBase()
{
Middle_GeometryCollection = CreateDefaultSubobject<UGeometryCollectionComponent>("Middle_GeometryCollection");
Middle_GeometryCollection->SetupAttachment(DefaultSceneRoot);
Middle_GeometryCollection->SetNotifyBreaks(true);
Middle_GeometryCollection->OnChaosBreakEvent.AddDynamic(this, &ACTreeFoliageBase::BreakEvent);
Middle_GeometryCollection->ObjectType = EObjectStateTypeEnum::Chaos_Object_Static;
Middle_GeometryCollection->DamageThreshold[0] = 250.f;
Middle_GeometryCollection->DamageThreshold[1] = 50.f;
Middle_GeometryCollection->DamageThreshold[2] = 25.f;
Middle_GeometryCollection->DamagePropagationData.bEnabled = false;
Middle_GeometryCollection->CollisionGroup = 1;
Middle_GeometryCollection->CollisionSampleFraction = 0.2f;
Middle_GeometryCollection->SetEnableDamageFromCollision(false);
Middle_GeometryCollection->SetCollisionProfileName("Destructible");
}
On BeginPlay I load an Geometry Collection and set it as an Rest Collection:
void ACTreeFoliageBase::BeginPlay()
{
Super::BeginPlay();
if (BaseChaosMesh.IsValid() && Middle_GeometryCollection != nullptr)
{
Middle_GeometryCollection->SetComponentTickEnabled(false);
Middle_GeometryCollection->SetRestCollection(BaseChaosMesh.LoadSynchronous());
Middle_GeometryCollection->SetComponentTickEnabled(true);
}
}
The strange thing is, I have a similar BP and there it works fine. So what did I missing? If I try to set the Geometry Collection in the Constructor it also didn´t work, so I don´t think it is an Problem with the runtime switching of the GC.
Anyone any idea how I can fix this problem? If you need some code stuff, I can send it later on in this thread, atm I´m on work now.