Description

Updating a procedural mesh results in an incomplete collision update. Collision bounds appear to get updated properly, but collision data is not updated, despite a navigation rebuild being triggered after updating the procedural mesh 

The root of this issue is that the function UProceduralMeshComponent::UpdateCollision is not called inside UProceduralMeshComponent::UpdateMeshSection.

This function does get called in UProceduralMeshComponent::CreateMeshSection and other public functions that affect modifying a mesh section. Manually calling via UProceduralMeshComponent::ClearCollisionConvexMeshes (which had no other side effects)  results in the expected outcome (nav mesh was updated).

Steps to Reproduce

   Steps to Reproduce:

  1. Setup a NavMesh using a navmesh bounds in your level editor viewport and visualize your navmesh using the P-key.
  2. Create an actor with a Procedural Mesh Component.
  3.  Create a procedural mesh using UProceduralMeshComponent::CreateMeshSection, make sure to have a value of true for bCreateCollision.
  4. Update the mesh using UProceduralMeshComponent::UpdateMeshSection, where the new vertices are larger than original.

 

Expected:

Calling UProceduralMeshComponent::UpdateMeshSection should update the navmesh collision if bCreateCollision is true when the mesh section was created.

Result:

Observe that navmesh has not been updated to reflect the larger procedural mesh.

 

 

Steps to Repro from  Attached Project Sample

  1. Open the DemoMap map.
  2. Visualize the nav mesh using the P-key, it should display as a green mesh over the level.
  3. Select the cube actor in the center.
  4. In the details window, modify the “Scale Incorrect” property, the cube should scale up. Observe how the navmesh recalculates (turns briefly red), but does not update to match the new size of the cube.
  5. Now try the “Scale Correct” property, note how the navmesh correctly recalculates and updates to match the new size.
  6. Click the UpdateMeshToDoubleScale button in the details panel, note that the mesh is now twice its original size, but the navmesh does not recalculate at all.

This indicates two separate issues:

  1. If the dynamic mesh is modified inside UObject::PostEditChangeProperty function, the NavMesh recalculates, but does not update to the new mesh unless UProceduralMeshComponent::ClearCollisionConvexMeshes is called as well.
  2. If the dynamic mesh is modified outside of PostEditChangeProperty, the NavMesh is not being recalculated at all.

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-92219 in the post.

4
Login to Vote

Won't Fix
ComponentUE - Simulation - Physics
Affects Versions4.234.244.25
CreatedApr 20, 2020
ResolvedJul 19, 2022
UpdatedJul 19, 2022
View Jira Issue