Line Renderer Component

From Pummel Party Mod Documentation
Jump to navigation Jump to search

The Line Renderer is a rendering component that can create a 3D line through the scene. It is primarily used for adding interesting visual effects and detail to a mod.

Component Settings

An example of a line renderer component and how it appears in the Scene View. The custom material uses the Particle Alpha Blend shader
Property Description
Positions An ordered list of positions. The line is constructed by connecting these points together.
Loop Connects the last position back to the first.
Use World Space Makes the positions relative to the world origin, rather than this gameobject's transform position.
Start Width The width of the line at the first position.
End Width The width of the line at the last position.
Corner Vertices How smooth the corners in the line should be. Higher numbers lead to smoother corners.
End Vertices How smooth the ends of the line should be. Higher numbers lead to smoother ends.
Start Color The color of the line at the start position. Some materials don't support setting a color.
End Color The color of the line at the last position. Some materials don't support setting a color.
Alignment Determines if this light source will cast shadows and whether they will have a soft or hard edge.
View The line will always try to face the camera.
Transform Z The line will always try to face the +Z axis of the gameobject's transform.
Texture Mode How the texture of this material should be drawn onto the line. Some materials don't support textures.
Stretch Stretches the texture along the length of the line. The texture doesn't repeat.
Tile Tiles the texture along the length of the line. The tiling is controlled by the texture tiling value of the material. Some materials don't support texture tiling.
Distribute Per Segment Stretches the texture once along the length of the line. The texture will be stretched equally between each point, rather than evenly across the entire line.
Repeat Per Segment Stretches the texture between each position on the line, repeating along the length of the line.
Materials A list of materials used by the line.
Cast Shadows Should the line cast shadows.
Off The line will not cast any shadows.
On The line will cast shadows from the visible side.
Two Sided The line will cast shadows from both sides.
Shadows Only The line will not be visible, only its shadow will.
Receive Shadows Should the line receive shadows from other shadow-casting objects.

Example Usage

Here line renderers have been used to make moving lasers for the player to avoid.

Possible uses for line renderers include:

  • A rope
  • Power lines
  • Lightning bolts
  • Lasers
  • Rainbows
  • A path (A winding carpet or a bridge made of energy/magic/light)