Component Types
In order to customize the components generated by a Path, you need to edit the PathTemplate Blueprints listed in the PathDescription of the Path. PathTemplates can contain various types of components, as described below.
Path Spline Components
When you create a new PathTemplate, the MainPathSpline (UEpPathSplineComponent
) is automatically generated. This component is crucial in defining the PathTemplate’s length and shape. Typically, the MainPathSpline is a straight line aligned along the Blueprint's X-axis and contains only two points.
PathSplines also act as attachment points where other paths can connect. PathTemplates for intersections may have multiple PathSplines, which often feature curved shapes (e.g., a circular spline for a roundabout).
You can add additional PathSplines in the same way as other components, attaching them to the root component. PathSplines within a PathTemplate can take any shape, though they are often basic shapes (e.g., |, X, Y, O). Once the path is generated in the level, these splines can be bent, stretched, or extended as needed. Any meshes placed along a spline will bend and move with it as it transforms in the level.
PathSplines also hold properties that control landscape or biome adjustments. These properties enable each PathTemplate to manage adjustments independently. For example, a "Bridge" PathTemplate might leave the landscape unchanged, whereas an "Asphalt Road" might modify it. Intersections, with their multiple PathSplines, can adjust the landscape individually for each branching road.
Static/Spline Meshes
For meshes, our two special classes - PathTemplateSplineMeshComponent
and PathTemplateStaticMeshComponent
should be used instead of the plain StaticMeshComponent
/SplineMeshComponent
. Our component types contain extra properties, such as randomization, landscape adjustment, spawning probability, etc.
Mesh Hierarchies
In order to make two meshes deform together, one of them needs to be attached/parented to the other in the PathTemplate's component hierarchy. The child will then follow the shape of the parent while preserving its own shape/deformation on top of that.
Meshes placed close to each other in the PathTemplate (but not parented to each other) are not guaranteed to deform in the same way. The reason is that SplineMeshes have only two control points (start/end), while the Path may have any number of spline points. Where the mesh starts/ends thus affects how it deforms.
Meshes extending beyond the bounds of a PathTemplate
Meshes are typically placed within the length of the PathSpline. They can extend further, but are not guaranteed to match the curvature of the Path or the neighboring PathTemplate in the level.
On the other hand, if meshes don't fill the length of the PathSpline, the spawned Path will contain gaps.
Decal Components
We provide a specialized class for decals UEpPathTemplateDecalComponent
that includes additional properties such as randomization, spawning probability, or spawning multiple copies.
Alternatively, meshes are often a better choice for horizontal decals, as they bend with the road, can be instanced and can be rendered cheaply with Runtime Virtual Texturing (RVT).
Spline Components
PathTemplates can also contain Splines UEpSplineComponents
. They can be used for AI, navigation or for guiding dependant Paths.
Spline components from neighboring PathTemplates are merged together when possible (if their types and start/end spline point positions match across the PathTemplate borders).
As splines often need to be loaded at a further view distance compared to the meshes (or always loaded), we support spawning splines in a separate SplineActor.
Other component types
PathTemplates can contain all types of components deriving from the USceneComponent
,
such as FX emitters, audio components, light sources, and more.
Child Actor Components
A Path can spawn actors by spawning UChildActorComponents
.
Group Component
- Errant Paths 1.1 and later
- Errant Paths 1.0 and prior
GroupComponent (EpPathTemplateGroupComponent
) allows setting a SpawnCondition to a group of components. It can also be used to spawn a group of components with a certain Spawn Probability or to Spawn Only One Child from the group.
To form a group, you need to add GroupComponent in the PathTemplate and attach child components to it. You can then apply a SpawnCondition to the GroupComponent, instead of applying it for each of the children.
What makes GroupComponent unqiue is that it's not spawned in the level and doesn't affect the transform of its children. Its children are spawned as if they were attached to the parent of the Group Component. For example, if your hierarchy is SplineMesh -> GroupComponent -> SplineMesh, it will spawn as if the hierarchy was SplineMesh -> SplineMesh. So the child SplineMesh will correctly bend with the parent.
Actor Components
ActorComponents can be used to add logic to a Path (ex: traffic lights switching). In order to add an ActorComponent to a Path create a Blueprint deriving from AEpPath
class and add ActorComponents there.
Then change the "Actor Template" property in the PathDescription to use your derived class instead of the plain AEpPath
.
Each ActorComponent is spawned once per Path.