How could I make a procedural mesh system in Unreal engine 5 so I could warp shapes like…
- 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
- 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:
- Create a highly-tesselated ground mesh
- At runtime, select a region (sphere/box) on that mesh
- Extrude that region upward (make pillars)
- 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
-
In Edit → Plugins
• Enable Geometry Scripting Editor (and, if you need it in game, also Geometry Scripting Runtime)
• Restart the Editor -
Make a Blueprint Actor, call it
BP_ProceduralGround.
• Add a ProceduralMeshComponent (or a Runtime Mesh Component if you prefer the community plugin). -
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 = TargetMeshYou 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:
-
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 isIt outputs an array of PolygonIDs.
-
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) -
Recompute normals/tangents on the changed mesh:
ComputeNormals → ComputeTangents
-
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 = MyGeoMeshVisually 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 byfalloff(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/UEditableMeshin the GeometryCore module. The logic is the same:
– Find triangles in a volume
– CallExtrudeon 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! 😊
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.