HomeModule plugins › AFM_Spline
Module

AFM_Spline

Spline mesh components and a helper for laying meshes along a spline, used by the teleport arc and cable-like props.

What it gives you

  • Meshes laid along a spline with tapering
  • Animated extend and collapse
  • Colour interpolation

Requires

AFM_AutoDestroy

Required by

AFM_WidgetInteraction AFS_UI_Labels AFS_UX_Laser AFS_UX_Teleporter

2 assets26 API members

Description

AFM_Spline draws continuous geometry along a curve. Its most visible use is the teleport arc, but it works equally for cables, hoses and pointer beams.

BP_Helper_Spline manages a set of BPC_SplineMesh sections along a SplineComponent, with independent start and end radii so the shape can taper, and ShowSplinePercent for animating the curve extending towards a target.

Setup

  1. Enable AFM_Spline.
  2. Spawn or place a BP_Helper_Spline.
  3. Set Radius Start, Radius End and Material.
  4. Call SetSplineLocations to define the curve.

Usage

Animating an arc

Call SetExpand to extend or collapse over a duration, optionally destroying the actor afterwards.

Reacting to a target

Use ShowSplinePercent to reveal the curve progressively as it approaches a valid destination.

Key properties

PropertyWhen to change
Radius Start / Radius EndTaper the shape
Spline ColorAppearance; interpolate for state changes
Interp SpeedHow quickly colour and endpoint changes blend

Extending

Derive from BPC_SplineMesh for custom section behaviour.

Performance notes

Performance

Each section is a spline mesh component. Keep section counts modest on mobile; the teleport arc uses a deliberately small number.

Example map

Visible as the teleport arc in Map_Examples_Teleporter.

Troubleshooting

The spline renders as straight segments. Too few sections for the curvature — increase the section count when creating the meshes.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Components

BPC_SplineMesh12 members
extends SplineMeshComponent
KindNameSignatureDescription
varColorStyleLinearColorColour written into the spline mesh material.
varInterp SpeedSettingsfloatHow quickly the mesh interpolates towards a new colour or end point.
varScaleStylefloatOverall thickness multiplier for the spline mesh.
fnTraceAndEndPoint(TraceLength: float = 1000, out Hit: HitResult)Traces forward along the spline direction and returns what it hit, so the spline can terminate on geometry.
fnUpdateEndPoint(EndLocation: Vector)Moves the far end of the spline mesh to the given world location.
fnSetExpand(Percent: float)Sets how much of the spline is drawn, from 0 for hidden to 1 for fully extended.
fnSetColor(Value: LinearColor)Sets the spline's colour on its dynamic material at once, with no blend. Use the helper's animated variant instead when the change should be seen.
fngetWorldEndLocationTransform() → VectorReturns the current world location of the spline's far end.
eventInterpolateToColor(ref const NewColor: LinearColor)Blends the spline colour towards the target over time.
eventExpand(Set: bool, Duration: float)Animates the spline extending or retracting over the given duration.
eventShow(Set: bool)Reveals the spline mesh. Passing false is ignored, so hide the mesh through the owning spline helper rather than expecting this to toggle both ways.
eventSetSizeScale(Scale: float)Changes the spline thickness at runtime.

Helper

BP_Helper_Spline14 members
extends Actor
KindNameSignatureDescription
varRadiusStartSizeVector2DCross-section radius at the start of the spline. Combine with Radius End to taper the shape.
varRadiusEndSizeVector2DCross-section radius at the end of the spline.
varSplineSplineSplineComponentThe spline component the meshes are laid along.
varMaterialSettingsMaterialInterfaceMaterial applied to every generated spline mesh section.
varSplineColorColorLinearColorColour written into the spline material.
fnCreateSplineMeshesSpline()Generates the mesh sections along the spline. Call after changing the spline point count.
fnUpdateSplineMeshesSpline()Repositions the existing mesh sections to match the current spline shape.
fnShowSplinePercentSpline(Percent: float)Reveals the spline up to the given fraction of its length, for animating an arc extending towards a target.
fnSetSplineLocationsSpline(StartLocation: Vector, EndLocation: Vector, ForwardVector: Vector)Sets the spline's start and end points and the tangent direction, rebuilding the curve between them.
fnSetSizeSize(RadiusStart: Vector2D, RadiusEnd: Vector2D)Sets the start and end radii immediately.
fnInterpolateSizeSize(RadiusStart: Vector2D, RadiusEnd: Vector2D, DeltaTime: float, InterpolationSpeed: float)Blends the start and end radii towards new values over time.
fnInterpolateColorColor(Target: LinearColor, DeltaTime: float, InterpSpeed: float)Blends the spline colour towards the target over time.
fnSetColorColor(Value: LinearColor)Sets the colour of every mesh segment along the spline at once, with no blend.
eventSetExpand(Set: bool, Duration: float, DestroyAfterCollapse: bool)Animates the spline extending or collapsing, optionally destroying the actor once it has collapsed.