Skip to main content

Prefab Splines

RustEdit Pro

A prefab spline places prefabs for you: in a row along the line, such as a fence or lamp posts, or scattered inside a closed line, such as a forest. The prefabs come from a prefab profile. While Live is on, RustEdit makes them again each time you change the spline or a setting.

A Prefab Line placing a wooden fence along a road, and a Prefab Area filled with beech trees

Before you start​

  • You need RustEdit Pro or higher. Without it, the prefab types are not in the type dropdown, the settings of prefab splines in a scene cannot be changed, and no prefabs are made.
  • Make a prefab profile with the prefabs you want, with their weights and random scale and rotation. See Prefab Profiles.

How to place prefabs along a spline​

  1. Make a spline entity and draw the line. For an area, close the spline. See Editing Splines.
  2. In the Inspector, click Prefab in the component buttons.
  3. In the Splines table, pick a Type in the spline's row: Prefab Line or Prefab Area.
  4. Click the row. Its Settings tab shows.
  5. Drag a prefab profile from the Content Browser, folder Profiles > Prefab Profiles, onto Prefab Profile. Or click Prefab Profile and pick one. The profile's prefabs are copied into the spline. With Live on, the prefabs are made.
  6. Change the options until the layout looks right.

Where the prefabs go​

  • The made prefabs are normal prefabs. In the Hierarchy they are under the spline entity, in an empty object for each spline, named after the spline entity and the spline, for example "Spline prefabs 1". So they move, hide and lock with the spline entity.
  • They are saved and exported like any other prefab. When you open a map exported with In RustEdit data, the prefabs come back in their group, and the prefab spline takes them back as its own.
  • A scene saved by an older version has the group at the top of the Hierarchy. It moves under its spline entity when you open the scene.

The types​

TypeWhat it does
Prefab LinePlaces prefabs along the line, a set distance apart: on the line, on one side, or on both sides.
Prefab AreaScatters prefabs inside the closed line. Areas of the same entity marked as Hole keep them out.

Options​

OptionTypesWhat it does
Prefab ProfileAllThe prefab profile the spline places. Its prefabs and weights are copied into the spline. When you save the profile in the Prefab Profile Editor, the spline takes the new prefabs at once, and with Live on makes them again. Right-click it for Open in Editor and Clear.
SpacingLineMeters between two prefabs along the line.
SideLineMeters to the side of the line.
Both SidesLinePlaces a row of prefabs on each side of the line. The second row is turned half a turn, so the two rows point opposite ways. Needs Side above 0.
Follow LineLinePrefabs turn with the line, not at random. The random Y turn of the prefab profile is left out.
TurnLineWith Follow Line on, degrees added to the turn of every prefab. A piece that stands across the line instead of along it needs a Turn of 90. Chainlink fence pieces run along the line at 0.
DensityAreaPrefabs for each 1000 square meters.
HoleAreaThis area places nothing and keeps the other areas of the entity out.
Min GapAreaThe least meters between two prefabs.
JitterAllRandom meters each prefab moves.
Max SlopeAllThe steepest ground a prefab goes on, in degrees.
On GroundAllPrefabs sit on the ground, not at the line's height.
SeedAllAnother number gives another random layout. The same seed gives the same layout.
LiveAllThe prefabs are made again by themselves when the spline or a setting changes.
Make PrefabsAllMakes the prefabs again now.
Remove PrefabsAllRemoves the made prefabs.

The label at the top shows how many prefabs the profile has, its name, and how many prefabs are made.

The prefab profile also sets each prefab's own options: its weight, whether it is on, its scale range, height offset, random rotations and whether it tilts with the ground.

Live and hand changes​

With Live on, the prefabs are made again a moment after your last change. While you hold a mouse button, for example while you drag a knot, RustEdit waits until you let go.

warning

Making the prefabs again throws the old ones away. A prefab you moved or changed by hand is lost at the next change of the spline or its settings. To keep hand changes, turn Live off first, or move the prefabs out of the group.

Undo and delete​

  • Make Prefabs and Remove Prefabs are undo steps. Ctrl+Z puts the old prefabs back.
  • Changes to the options rows are undo steps.
  • With Live on, undoing a change to the knots makes the prefabs again from the old spline.
  • When you delete a prefab spline entity, its made prefabs are deleted with it. One Ctrl+Z brings back the spline and its prefabs.
  • When you give a spline another Type in the Splines table, or pick another component button (for example Path in place of Prefab), the prefabs it made are deleted. One Ctrl+Z brings back the type and the prefabs.
  • A Prefab Line that becomes a Prefab Area, or back, keeps the options of all types: Prefab Profile, Jitter, Max Slope, On Ground, Seed and Live. The options of one type start at the new type's defaults. With Live on, it makes its prefabs again for the new type.

Copies​

A copy of a prefab spline entity (Ctrl+D) copies its made prefabs too, under the copy. The copy uses its own prefabs from then on. It does not take over the prefabs of the spline it was copied from.

Tips​

  • An area with On Ground off places its prefabs at the average height of its line.
  • One area can hold at most 20,000 prefabs.
  • To clear a space in an area, add a second closed spline to the same entity, make it a Prefab Area and turn on Hole.