Skip to content
CRUSHFORMV1.1.0
GET IT ON FAB

REFERENCEACTORS

ACFBreakableFence

MODULECrushformBreakableINCLUDECFBreakableFence.hPARENTAActor

A line of breakable posts and spans laid along a spline. The layout is saved with the level, so unit indices match on every machine; units break from hits and bodies and come back after their definition's respawn delay.

Functions

AUTHORITY · server, every machineLOCAL · this machinePURE · read only
void RebuildLayout()
C++ ONLY

Recomputes Units from the spline. Runs when the fence is edited in the editor, when it has no layout yet, and for a fence spawned in a standalone game. A load, the cook and a networked game never re-lay: the build ships the saved layout, and unit indices must match on every node.

USplineComponent* GetSpline() const
PUREC++ ONLY

The spline the fence follows.

UCFBreakableInstancesComponent* GetBreakableInstances() const
PUREC++ ONLY

The component that breaks, replicates and respawns the fence's units.

UInstancedStaticMeshComponent* GetPostInstances() const
PUREC++ ONLY

The instances that show the posts.

UInstancedStaticMeshComponent* GetSpanInstances() const
PUREC++ ONLY

The instances that show the spans.

const TArray<FCFBreakableUnit>& GetUnits() const
PUREC++ ONLY

The saved layout: every post and span, in the order of their unit indices.

Properties

TObjectPtr<UCFBreakablePropDefinition> PostDefinition
Category
Fence
TObjectPtr<UCFBreakablePropDefinition> SpanDefinition

The span between two posts. Required to lay out the fence; its tile length sets the span length and the default post spacing.

Category
Fence
float PostSpacingCm = 0.f
Default
0.f
Category
Fence
bool bSnapToGround = true

Traces down to the world's static geometry and stands each post on the hit point; off, posts stay on the spline.

Default
true
Category
Fence
float GroundTraceHalfHeightCm = 500.f

Half the length of the ground trace, in cm: it runs this far above and below each post's spline point.

Default
500.f
Category
Fence
float PostSinkCm = 5.f
Default
5.f
Category
Fence
TObjectPtr<USplineComponent> Spline
Category
Components
TObjectPtr<UCFBreakableInstancesComponent> BreakableInstances
Category
Components
TObjectPtr<UInstancedStaticMeshComponent> PostInstances
Category
Components
TObjectPtr<UInstancedStaticMeshComponent> SpanInstances
Category
Components