Menu

Menu

Unity

Unity

Unity

Feb 23, 2026

Feb 23, 2026

ArrayKit-Documentation

ArrayKit is a single-script Unity Editor window that removes the tedium of manually duplicating and positioning objects. Whether you are populating a level with fence posts, arranging columns around a courtyard, filling a crate warehouse, or scattering foliage across terrain, ArrayKit handles placement in seconds — fully undoable, with a live ghost-mesh preview that updates as you type.

Getting Started

ArrayKit is a Unity Editor tool that lets you scatter, duplicate, and arrange GameObjects into any number of spatial configurations without writing a single line of code. Whether you need a straight row of street lamps, a circular formation of enemies, a 3D grid of crates, or objects arranged along a hand-crafted Spline path, ArrayKit handles the heavy lifting directly inside the Editor window.

Requirements

ArrayKit requires Unity 2021.1 or later. Path Array functionality additionally requires Unity 2022.1 or later together with the Unity Splines package (com.unity.splines), available via the Package Manager.

Installation

Copy ObjectArrayTool.cs into any Editor folder inside your project's Assets directory. Unity will automatically compile it as an Editor-only script.

A compile error at this stage almost always means the file has been placed outside an Editor folder. The script references UnityEditor APIs that are unavailable at runtime, so the folder location is not optional. Move the file and Unity will resolve the issue.

Opening the Tool

Once the script has compiled successfully, open the window via the menu bar:


Tools > Object Array Tool
Tools > Object Array Tool
Tools > Object Array Tool

The window is titled ArrayKit in the title bar. It can be docked anywhere in the Editor layout like any other Unity window.

The Interface at a Glance

The window is divided into two tabs: Array and Settings. The Array tab is where you configure your source object, choose your array type, and apply transform modifiers. The Settings tab controls output naming, start position, preview options, and the random seed. A live Scene View preview updates automatically as you adjust values, showing ghost meshes in the viewport so you can see the result before committing.

Your First Array in Three Steps

Step 1 — Set a Source. In the Source section at the top of the Array tab, choose one of three source modes: Scene Object (drag a GameObject from the Hierarchy), Prefab (drag from the Project window), or Multiple Objects (build a list of objects to cycle through). With Scene Object selected, simply click on any object in your scene and it will populate the source field automatically.

Step 2 — Choose a Type and Count. Select Linear from the Type dropdown under Array Settings. Set Mode to By Count and drag the Count slider to 5. Leave the Direction on X and set Total Distance to 10. The orange ghost meshes in the Scene View will update instantly.

Step 3 — Generate. Press the Generate Array button at the bottom of the window. ArrayKit will instantiate the objects into the scene, grouped under a parent GameObject named ObjectArray (or whatever name you configured in the Settings tab). The operation is fully undoable via Ctrl+Z / Cmd+Z.

Tip: Enable Group Under Parent in the Settings tab to keep your Hierarchy tidy. All generated objects will be children of a single empty GameObject.

Array Types

ArrayKit supports five distinct array types, each suited to a different spatial arrangement. You switch between them using the Type dropdown at the top of the Array Settings section. The Scene View preview updates immediately so you can compare shapes without committing.

Linear

A Linear array places objects in a straight line along a chosen world-space axis. It is the simplest and most commonly used type. Two modes control how objects are distributed.

Mode: By Count — You specify the total number of objects and the total distance. Spacing between objects is calculated automatically.

Mode: By Spacing — You specify the gap between each object and the total distance. The object count is derived from those two values.

The Direction row provides six preset axis buttons (X, Y, Z and their negatives) plus a Custom vector field for arbitrary directions.

The Distribution dropdown controls how objects are spread along the line: Linear (even), Ease In, Ease Out, Ease In/Out (clustered at the start, end, or both ends), or Randomised (irregular spacing within the total distance).

Grid 2D

A Grid 2D array fills a flat rectangular area. You configure each axis independently, choosing a direction vector, a count, and a spacing value. The total object count is the product of both axes' counts.

Both axes support the same direction presets as Linear. You can set the first axis to X and the second to Z for a standard ground-plane grid, or combine any two axes for a tilted or vertical grid.

Grid 3D

Grid 3D extends the flat grid into three dimensions, giving you a full volumetric arrangement. Each of the three axes has its own direction, count, and spacing controls. A warning is displayed in the Editor when the total object count exceeds 1,000, as very large 3D grids can introduce noticeable scene performance overhead during authoring.

Radial

A Radial array distributes objects around a central point in a circular or arc formation. It is ideal for columns, pillars, arena formations, rotating mechanisms, or any geometry with rotational symmetry.

Axis sets the axis around which objects orbit, defaulting to Y for a ground-plane circle. Radius sets the distance from the centre point to each object. Count controls how many objects are placed around the arc.

The Arc Range fields accept start and end angles in degrees. A full 360° creates a closed ring; any smaller value produces an arc. Quick preset buttons for 180° and 360° are provided for convenience.

Face Centre rotates objects to face the centre of the ring. The Face Outward toggle reverses this so objects face away from the centre.

Setting a non-zero Helix Height turns the circle into a helix (spiral). The Loops field controls how many full rotations occur over the total height.

Path

Path arrays distribute objects along a Unity Spline, following its curve precisely. This is the most powerful array type and requires Unity 2022.1 or later with the Splines package installed.

Drag a GameObject containing a SplineContainer component into the Spline Container field. If the container holds multiple splines, the Spline Index slider selects which one to use. Mode works the same as Linear: By Count or By Spacing.

The T Range slider controls which portion of the spline is used. A range of 0 to 1 spans the full spline; narrower ranges use only a segment. This makes it straightforward to place objects on just one curve of a multi-curve path.

Alignment has three options: None (objects keep their source rotation), Align to Tangent (objects face the spline's direction of travel), or Align to Tangent and Up (additionally tilts objects to follow banking curves). The Offset Vector3 field shifts each object relative to the spline's local frame, useful for placing objects to the side of or above the path.

Note: Path Array is disabled in Unity versions before 2022.1. If you are on an older version, the section displays a warning and no objects will be generated.

Transform Controls

The Transform section in the Array tab applies per-object modifications to rotation, scale, and position on top of the base array layout. These controls let you introduce variation, rhythm, or organic randomness without any additional setup.

Rotation Modes

The rotation dropdown provides six behaviours, each mutually exclusive.

Keep Original — Every object inherits the exact rotation of the source object. No modification is applied.

None — All objects are placed with zero rotation (identity quaternion), regardless of the source.

Incremental — Each successive object is rotated by a fixed amount relative to the previous one. Quick preset buttons (, 15°, 30°, 45°, 90°) set common Y-axis values; the full Per Object Vector3 field allows any axis and angle combination.

Random — Each object receives a random rotation sampled uniformly between a Min and Max Vector3. Setting Min and Max to the same value on an axis locks that axis.

Look At Centre — Objects are rotated to face the centre of the array. Particularly useful with Radial arrays.

Look At Next — Each object is rotated to face the next object in the sequence, creating a chain-like orientation. The final object repeats the previous rotation.

Align to Path — Only meaningful with Path arrays; the rotation follows the spline tangent direction, equivalent to the Path Alignment setting.

The Add to Source toggle (available on most modes) blends the calculated rotation on top of the source object's own rotation rather than replacing it entirely.

Scale Modes

Keep Original — All objects use the source scale.

None — All objects use a uniform scale of (1, 1, 1).

Incremental — Scale changes by a fixed amount per object. Enable Uniform to control all three axes with a single value; disable it for per-axis control. The Multiply Source toggle applies the increment multiplicatively against the source scale rather than additively.

Random — Each object receives a random scale. In Uniform mode, a min/max slider controls the range. In non-uniform mode, separate Min and Max Vector3 fields are shown.

Position Offset

The Random Offset toggle adds a random world-space displacement to each object's final position. Min and Max Vector3 fields define the range independently on each axis. Setting both Min and Max to zero on an axis leaves that axis unaffected. This is useful for adding subtle irregularity to otherwise perfectly regular grids or linear arrays, mimicking how naturally placed objects are never perfectly aligned.

Using Multiple Objects

When Source Mode is set to Multiple Objects, a list appears that can be populated manually or via the Add Selected button, which adds everything currently selected in the Hierarchy or Project window.

Cycle Through Objects places objects from the list in order, repeating from the beginning once the list is exhausted. This creates a regular, predictable pattern. Randomise Order selects an object from the list at random for each position. Enabling a custom seed in the Settings tab makes this result reproducible across sessions.

Tip: Randomise Order combined with a custom seed is the recommended approach for scattering environment props such as rocks and foliage. The seed means you can close and reopen the tool and regenerate an identical result.

Snap to Surface

The Snap to Surface section projects each object onto the nearest collider in your scene using a raycast. This is invaluable for placing objects on uneven terrain, stairways, or any surface that is not flat. The section is collapsed by default; click the foldout header to expand it.

How It Works

After calculating the base position for each object using the chosen array type and any transform modifiers, ArrayKit fires a raycast from that position in the specified direction. If the ray hits a collider on an included layer, the object is moved to the hit point. The operation runs entirely in the Editor and does not require Physics components on the arrayed objects themselves.

Snap Settings

Enable is the master toggle for the entire snap system. When off, no raycasting occurs.

Layer Mask restricts which colliders the ray can hit. Defaults to Everything. Exclude layers such as triggers or character colliders to avoid unintended snapping targets.

Ray Distance sets the maximum length of the ray in world units. Increase this if objects placed high above terrain are not snapping correctly.

Surface Offset applies a displacement along the ray direction after snapping. Positive values lift the object above the surface; negative values push it into the surface.

Ray Direction provides preset buttons: Down, Up, and Forward. Down is the most common choice for terrain placement.

Align to Normal rotates the object so that its local up axis aligns with the surface normal at the hit point. This tilts objects to stand perpendicular to slopes, suitable for rocks and vegetation.

Common Workflows

Scattering objects across terrain. Set your array type to Grid 2D with a wide spacing and moderate count. Enable Snap to Surface with Direction set to Down and a generous Ray Distance. Enable Align to Normal so objects tilt naturally with the slope. Enable Position Offset with a small XZ range to break up the perfect grid regularity.

Placing objects on a ceiling. Set Ray Direction to Up. Place your array origin below the ceiling. Objects will snap upward to the ceiling geometry. Use a negative Surface Offset to embed objects slightly into the ceiling surface if needed.

Following a wall. Set Ray Direction to Forward. Orient your array along the wall surface, then snap objects forward onto it. This works well for placing decals, wall-mounted props, or hanging lights.

Important: Snap to Surface uses Physics.Raycast and will only hit colliders present in the scene at generation time. Objects with no Collider component are invisible to the snap system. Ensure your terrain or target meshes have Mesh Colliders attached before generating.

Settings

The Settings tab contains output configuration, the random seed, and Scene View preview controls. These settings apply globally to any array you generate regardless of the type selected on the Array tab.

Output Settings

Array Name sets the name assigned to the parent GameObject that groups all generated objects. Defaults to ObjectArray.

Group Under Parent places all generated objects as children of a single empty parent object, keeping the Hierarchy tidy. When disabled, objects are placed at the scene root level.

Parent is visible when Group Under Parent is on. Drag an existing Transform here to nest the generated array inside it rather than at the scene root.

Use Source as Start uses the source object's world position as the starting point for the array, meaning the array begins exactly where your source object sits. When disabled, a manual Start Position Vector3 field appears so you can type in an exact world-space origin.

Update Existing (Replace Mode)

Replace Mode allows you to regenerate an array in-place rather than creating a new one from scratch. Enable Replace Mode and drag an existing array parent GameObject into the Existing Array field. When you press Generate Array, ArrayKit will delete all current children of that object and regenerate fresh ones with the current settings. The child count of the existing array is displayed for reference.

Tip: Replace Mode is the recommended approach during iterative level design. Configure your array, generate it, tweak values, then regenerate with Replace Mode rather than manually deleting the old array each time. The action is still fully undoable.

Random Seed

The Random Seed section controls the seed used for all randomised operations in the tool, including Random rotation, Random scale, Randomised distribution, and the Randomise Order mode for multiple objects.

When Use Custom Seed is off, Unity's global random state is used, meaning results differ on each generation. When on, ArrayKit sets the seed before generating so the result is reproducible. The Randomise button sets the seed field to a new random integer, giving you a quick way to explore variations while retaining reproducibility.

The practical value of custom seeds is significant in a production environment: two team members using the same seed on the same settings will produce bit-for-bit identical results, making version control reviews predictable and eliminating "it looks different on my machine" situations.

Preview

The preview system renders ghost meshes in the Scene View to visualise the array before it is committed to the scene. It updates automatically whenever any setting changes.

Show Preview toggles the Scene View ghost mesh overlay on and off. Disabling preview can improve responsiveness when working with very large arrays (500+ objects).

The colour swatch next to the toggle sets the colour and opacity of the ghost meshes. The default is a semi-transparent orange matching the ArrayKit accent colour.

Refresh forces a manual preview recalculation. Rarely needed as updates happen automatically, but useful if the preview appears stale after an external scene change.

Focus in Scene frames the preview in the Scene View camera, equivalent to pressing F on a selected object. Helpful for quickly orienting the viewport when working in large scenes.

Note: Preview ghost meshes are Editor-only and have no impact on runtime performance or build size.

ArrayKit by daCruz.devdacruz.dev/tools/arraykit