Home

Awesome

Instant Pipes

An editor tool for procedurally generating pipes by just dragging the cursor from start to end — the pipe will find the path in a customizable way.

Unity_3wtlMTU9I1

Compatibility

Unity 2019.4 or higher.

Installation

Add the package to your project via the Package Manager using the Git URL https://github.com/leth4/InstantPipes.git. You can also clone the repository and point the Package Manager to your local copy.

Usage

Starting out

  1. Create an empty GameObject and set its world position to zero.
  2. Add a Pipe Generator component.
  3. Select a material for the Material property.

If you're facing problems, visit the troubleshooting section.

Ctrl+Z works with all actions. When you're commited to the pipes, you can just remove the component, the mesh will stay.

Pipes Settings

Using pathfinding

In the component inspector, select the Create tab. Now in the scene view start dragging your cursor where you want the pipe to start, end let go where you want it to end; a pipe will appear.

The tool uses A* pathfinding without a predefined grid — by raycasting from a point to the next points. Pipes can only detect colliders as obstacles.

PropertyExplanation
Preview PathWill preview how the pipe will look like while dragging. Can be slow with complex pipes!
AmountHow many pipes will be created at once; each one will have an individual path.
Max IterationsHow many points will the algorithm check before giving up.
Grid Y AngleRotates the Y axis of the pathfinding grid that every pipes have to follow.
Grid SizeThe distance between searched points; making it too small can produce bad results.
HeightHow high the first and the last segment of a pipe will be. This value can't be smaller than grid size.
ChaosAdds randomness to the pathfinding, making paths twisted and chaotic.
Straight PriorityMakes the algorithm prefer straight paths over turns.
Near Obstacle PriorityMakes the pipes stay close to obstacles.

image

Manual Editing

In the component inspector, select the Edit tab. Select one of the points in the scene view by clicking on it, and then you can:

Hold shift to select multiple points. Press A to select every point of the selected pipe.

Every pipe is a separate submesh, so you can assign separate materials by dragging them into the scene view.

Troubleshooting

Getting an error when trying to build

Pipes appear squashed

Dragging my cursor doesn't do anything

Pipes can't find a way