ProceduralMeshComponent doesn't simulate phyiscs properly

I’m trying to create procedural objects with physics enabled, but I’m having a little trouble.

I’m creating a simple box, and I would like it to simply fall to the ground when the game starts.

This is the code:



    TArray<FVector> mVertices;
    TArray<int32> mIndices;
    TArray<FVector> mNormals;
    TArray<FVector2D> mUvs;
    TArray<FProcMeshTangent> mTangents;
    TArray<FColor> mVertexColors;

    UKismetProceduralMeshLibrary::GenerateBoxMesh(FVector(100, 100, 100), mVertices, mIndices, mNormals, mUvs, mTangents);
    mMesh->CreateMeshSection(0, mVertices, mIndices, mNormals, mUvs, mVertexColors, mTangents, true);

    mMesh->RegisterComponent();

    mMesh->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
    mMesh->bUseComplexAsSimpleCollision = false;
    mMesh->SetSimulatePhysics(true);


This is done in the BeginPlay() of some actor. When the game starts, the box does appear and it starts falling down from its initial position, like you would expect. The problem is that when it hits the floor or anything else it just keeps going.

I’m using the FPS Template as training room, which has other pre-made boxes around the level that have phyisics. I looked into their properties, and they’re the same as the procedural box. I don’t understand what I’m doing wrong.

well, it may fall too fast, so collision state calculated incorrectly. try to enable ccd (mMesh->BodyInstance.bUseCCD = true)

also, if we are talking about mobile device, it is to be expected since there is no physics for procedural meshes on mobile device, unless you use your own build of the engine.

It’s not running on a mobile device, and it’s not falling down too fast. It falls down like any other object.

Actually for now I discovered that I didn’t need physics on these kind of object, but sitll I’m interested if anyone has other ideas on this.