Git Product home page Git Product logo

instantpipes's Introduction

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 2021.3 or higher.

Installation

Add the package to your project via the Package Manager using the Git URL https://github.com/letharqic/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 your pipes appear squashed, toggle and re-toggle rings, that will fix it. Looking into it!

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

  • Curvature changes the length of the curved parts, making pipes appear more or less curvy. Note that it applies after pathfinding, so in some cases high curvature value can make pipes intersect.
  • Edges property selects how many edges the pipes will have, and Segments is the amount of subdivisions in curved parts.
  • You can toggle Rings and End Caps and separately set up their radius and thickness.

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.

Property Explanation
Amount How many pipes will be created at once; each one will have an individual path.
Max Iterations How many points will the algorithm check before giving up.
Grid Size The distance between searched points; making it too small can produce bad results.
Height How high the first and the last segment of a pipe will be. This value can't be smaller than grid size.
Chaos Adds randomness to the pathfinding, making paths twisted and chaotic.
Straight Priority Makes the algorithm prefer straight paths over turns.
Near Obstacle Priority Makes the pipes stay close to obstacles.

image

Manual Editing

In the component inspector, select the Edit tab. Now you can select any point of any pipe by clicking on it, and then either move it in the scene view or delete the point, delete the entire pipe or insert a new point via buttons in the inspector. Hold shift to select multiple points.

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

instantpipes's People

Contributors

leth4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.