Skip to main content

Spawning at Interval

Meshes may be spawned along the single or multiple Paths at a given interval. E.g. you may want to spawn electrical poles along a road and keep the poles at a certain distance from each other. This is done using Spawning/Placement/Placement Method = Interval Along Path. The distance is measured along the PathSpline between meshes with the selected Tags.

Basic example - electrical poles

Open the Path's PathTemplate

Add a PathTemplateStaticMesh representing the electrical pole

In the mesh's Details panel go to Spawning/Tags, add "Pole"

Go to Spawning/Placement, set the Placement Method to the Interval Along Path, the Search Tags to "Pole" and the Interval to "20 m" (2000 cm)

Update your Path. Notice the poles spawning with a 20 m interval.

Conditional spawning

The Interval value is treated as the minimum distance for spawning your mesh. This means that if the mesh has a spawn condition that prevents it from spawning exactly at the desired interval, it will be spawned as soon as possible past the interval. E.g. if the electrical poles from the above example are only allowed to spawn on a straight section of the road and the interval points to a middle of a turn, then the pole will be spawned right after that turn.

Limitations

Spawning at interval imposes a constraint on where (and if) a component can be spawned within a PathTemplate instance. Whenever a PathTemplate is spawned in the map, components using interval placement method check the distance to the nearest object with the user-defined tag. If it is possible to place the new component within the PathTemplate instance while satisfying the constraint, the component is spawned. Otherwise it isn't. This means:

  • components can't be placed with an interval denser than the template's length (i.e. a single template component may be placed at most once per template instance)
  • in some cases a component may not be spawned at all if interval constraints cannot be satisfied