Skip to content
TheChatArchiveThe Chat Archive
o4-mini-2025-04-16· OpenAIHugging Face LMArena Human Preference 140K

How could I make a procedural mesh system in Unreal engine 5 so I could warp shapes like…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4.1-mini-2025-04-14’s answer.
  1. User

    How could I make a procedural mesh system in Unreal engine 5 so I could warp shapes like ground into pillars and take away space from the ground, like Fullmetal Alchemist Brotherhood

  2. Assistant

    Here’s one way to build a “ground → pillars (and holes)” effect at runtime in UE5, using only built-in tools (no Houdini, no paid plugins). We’ll:

    1. Create a highly-tesselated ground mesh
    2. At runtime, select a region (sphere/box) on that mesh
    3. Extrude that region upward (make pillars)
    4. Optionally remove/subtract that region from the original ground

    You can do it either in C++ (via the new DynamicMesh/EditableMesh APIs) or in Blueprints using the Geometry Scripting plugin. Below is a Blueprint-first approach—if you need pure C++ just let me know.


    1. Setup

    1. In Edit → Plugins
      • Enable Geometry Scripting Editor (and, if you need it in game, also Geometry Scripting Runtime)
      • Restart the Editor

    2. Make a Blueprint Actor, call it BP_ProceduralGround.
      • Add a ProceduralMeshComponent (or a Runtime Mesh Component if you prefer the community plugin).

    3. In its Construction Script (or you can do it in BeginPlay if you need it dynamic), add a Geometry Script call chain to build and deform your mesh.


    2. Build a tesselated plane

    Use Geometry Script to start from scratch:

    Blueprint Pseudocode in Construction Script:

    // 1) Create a fresh mesh
    CreateNewMesh TargetMesh
    
    // 2) Generate a subdivided plane
    GenerateGridMesh
       OutMesh = TargetMesh
       NumX = 100        // number of quads in X
       NumY = 100        // number of quads in Y
       SizeX = 2000.0    // world size X
       SizeY = 2000.0    // world size Y
    
    // 3) Compute normals/UVs
    ComputeNormals          InMesh=TargetMesh  OutMesh=TargetMesh
    ComputeTangents         InMesh=TargetMesh  OutMesh=TargetMesh
    GenerateUVs_BoxProject  InMesh=TargetMesh  OutMesh=TargetMesh
    
    // 4) Push it into the ProceduralMeshComponent
    SetProcMeshFromGeometryScript  
       TargetComponent = ProceduralMeshComponent
       GeometryScriptMesh = TargetMesh
    

    You now have a 100×100 grid plane you can carve or extrude at runtime.


    3. Select & Extrude a region

    When you want to “warp” an area into a pillar:

    1. Find Polygons inside a sphere/box volume around your hit‐point.
      • Node: FindPolygonsInSphere (or Box)
      • Inputs:
      – Mesh = your TargetMesh
      – SphereCenter = location you clicked on (in local mesh space)
      – Radius = how wide the effect is

      It outputs an array of PolygonIDs.

    2. Extrude those polygons upward along Z:
      • Node: ExtrudePolygons
      • Inputs:
      – Mesh = your TargetMesh
      – PolygonIDs = from step 1
      – OffsetDirection = (0,0,1)
      – Distance = pillar height (e.g. 500)
      – bKeepOriginal = false (so you remove the original ground there)

    3. Recompute normals/tangents on the changed mesh:

      ComputeNormals → ComputeTangents

    4. Update your ProceduralMeshComponent:

      SetProcMeshFromGeometryScript → TargetMesh

    That one click (or function call) will take your flat ground, carve out the selected polygons, and extrude them into pillars.


    4. Blueprint Example

    Below is a minimal sketch of the node‐flow in your Actor’s Event Graph (you can wrap this in a function like “WarpAtLocation”):

    Event BeginPlay
      → BuildInitialGridMesh()    // steps from §2
      → SetProcMeshFromGeometryScript
    
    // …later, e.g. on mouse click…
    Event OnClick(HitLocation)
      LocalPos = ProceduralMeshComponent.WorldToLocal(HitLocation)
      Call FindPolygonsInSphere
        MeshIn = MyGeoMesh
        Center = LocalPos
        Radius = 200
    
      Call ExtrudePolygons
        MeshIn = MyGeoMesh
        Polygons = (from FindPolygonsInSphere)
        Offset = (0,0,1) * 400
        KeepOriginal = false
    
      Call ComputeNormals+Tangents → MyGeoMesh
    
      Call SetProcMeshFromGeometryScript
        MeshIn = MyGeoMesh
    

    Visually this will:
    • Carve out a circular patch of your plane
    • Create a matching pillar (the extruded faces)
    • Update your mesh in one shot


    5. Tips & variations

    • If you just want a smooth warping (no hard “extrude”), you can skip Geometry Scripting and simply manipulate vertex Z in a ProceduralMeshComponent:
    – Loop over all vertices, compute distance to center, push them up by falloff(dist).

    • For holes only, use the BooleanSubtract node instead of Extrude, or after extruding you can delete the bottom cap.

    • If you need tons of terrain editing (voxel-style), check out the free Voxel Plugin by Phyronnaz—that gives you smooth digging and pillar building out of the box.

    • For pure C++, look into UDynamicMesh / UEditableMesh in the GeometryCore module. The logic is the same:
    – Find triangles in a volume
    – Call Extrude on those polygons
    – Rebuild the render mesh


    That’s the core of a Fullmetal Alchemist–style ground warp in UE5. Enable Geometry Scripting, extrude the polygons you want, and feed them back into your Procedural Mesh Component. Give it a shot and let me know where you get stuck! 😊

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.