In this lesson, you will learn how to use Anchor Fields to designate specific parts of a Geometry Collection as "unbreakable," ensuring your buildings don't crumble like sandcastles the moment they take damage.
The Problem: Total Collapse
When you fracture a mesh in Chaos, the engine treats every piece as an independent dynamic object subject to gravity. If you destroy a wall at the base, the entire structure will realistically—but often frustratingly—collapse instantly. In game design, we usually want specific sections (like foundations or load-bearing pillars) to remain anchored to the world, providing a sense of structural integrity.
Integrating Anchor Fields
An Anchor Field acts as a constraint that effectively "pins" pieces of your Geometry Collection to their original transform, overriding the default physics simulation.
To implement this, you use a Field System Actor. Instead of using a Radial Force to push objects, you use a Master Field with an Anchor node.
- Create a Field System Actor: Place it in your level and position it where you want the "support" to be (e.g., the foundation of a building).
- Setup the Anchor: Inside your
Field System Actor, set the evaluation type toField_EFieldPhysicsType::Field_PhysicsType_ExternalClusterStrainor apply theAnchorfield directly. This forces the engine to ignore gravity and impact forces for any pieces currently intersecting that field’s volume. - Logic Implementation: You can trigger this via Blueprints using the
Apply Physics Fieldnode.
// Conceptual flow for applying an anchor field
void AStructuralSupport::InitializeAnchor() {
// We define the field region to be "static"
// Any chunk inside this bounds will resist structural failure
FieldSystemComponent->ApplyPhysicsField(
true,
Field_PhysicsType_ExternalClusterStrain,
nullptr,
AnchorFieldNode
);
}
Why Use This?
By applying an Anchor Field to the base of your Geometry Collections, you create a "safe zone." Even if you blast the upper floors with a Radial Force Field, the bottom floor will remain locked in space, allowing players to destroy a tower while leaving the foundation intact. This technique is essential for balancing visual destruction with gameplay requirements for stable environments.
Key Takeaway: Anchor Fields override physics simulations for selected geometry clusters, allowing you to selectively freeze parts of a mesh in place to preserve essential structural supports.