Procedural mesh component doesn't generate overlap events for collision data

For VR, I am trying to make a simple cube procedural mesh with a simple collision that always aligns with the four points of the cube. I would like the player be able to reshape this mesh at runtime by selecting and moving any of the four corners of the cube independently to a new location with the collision being updated to match.

So far, I have been unsuccessful with getting overlap events to occur with the procedural mesh collision.

To create the procedural mesh and collision, I use the Kismet ProcMesh function GenerateBoxMesh, and then I select the simple box vertices from this mesh to create the collision.

Here is my setup code for vertices and collision where Mesh is my procedural mesh:

Mesh = CreateDefaultSubobject<UProceduralMeshComponent> (TEXT("BoundsMesh"));
Mesh->AttachToComponent (RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
UKismetProceduralMeshLibrary::GenerateBoxMesh ({ 25, 25, 25 }, MeshVertices, MeshTriangles, MeshNormals, MeshUVs, MeshTangents);
Mesh->SetMobility (EComponentMobility::Movable);
Mesh->SetCollisionEnabled (ECollisionEnabled::QueryOnly);
Mesh->SetCollisionObjectType (ECollisionChannel::ECC_WorldDynamic);
Mesh->SetGenerateOverlapEvents (true);

Mesh->bUseComplexAsSimpleCollision = false;
Mesh->CreateMeshSection (0, MeshVertices, MeshTrianlges, MeshNormals, MeshUVs, TArray<FColor>(), MeshTangents, true);

// Here we access the simple bounding 8 vertices of the cube
Mesh->AddCollisionConvexMesh ({ MeshVertices[0], MeshVertices[1], MeshVertices[2], MeshVertices[3],
                                MeshVertices[20], MeshVertices[21], MeshVertices[22], MeshVertices[23] });

In the UE editor, I see my expected collision settings in the inspector which have worked for other usages in my project. In the editor I also see the collision lines correctly bounding the box as I expect.

But, when playing in VR, I do not get any overlap events.

Anybody have any suggestions about this?
Is collision and overlap actually supported for Procedural Mesh Component?

hi Tim, i am facing the same problem in my project, did you find the solution for this?

Can you please try this
Mesh->bUseComplexAsSimpleCollision = false;
Mesh->CreateMeshSection_LinearColor(0, VerticesArray, FacesArray, NormalsArray, TextureCoordinatesArray, VertexColorsArray, TArray(), true);

Mesh->SetCollisionConvexMeshes({ VerticesArray });

1 Like

This is still valid and applies to blueprints too.
In BP the “Use Complex as Simple Collision” flag (first row) is in the ProceduralMesh component Details. The second row sets the “Create Collision” flag to True, and in BP you find it on the “Create Mesh Section” node. Then the last row in BP is a node called “Add Collision Convex Mesh” which needs the vertices array from the Procedural Mesh.

After doing this the overlap events finally work! (Leaving this for posterity, also be sure to check Generate Overlap Events in the ProceduralMesh component is set to true and collision presets to OverlapAll)

Thank you.

1 Like