Beam Component
The beam component renders a thick line (a "beam") starting at the position of the beam component's owner game object and ending at the position of a selected target object. If the object at either end moves, the beam moves with it. The beam component can be used to implement laser beams, for example from trip mines.

The beam component is purely a graphical effect, it has no game play functionality. It also has no logic to decide how long the beam shall be, other than the optional MaxLength. To adjust the length of the beam, the target object has to be positioned at the desired distance. The raycast placement component works well in conjunction with the beam component, as it uses a raycast to decide where to move a referenced object to. You can attach both components to the same object and let them reference the same (dummy) target object, to get a beam that always stretches towards the closest obstacle.
Component Properties
TargetObject: The beam geometry starts at the beam component position and goes towards the position of the referenced object. If the target object moves, the beam follows.Material: The material to use to render the beam geometry with.Color: The tint color for the material. The shader gets it as the instance color.CustomData: Four values that the shader gets as the instance custom data. The beam component does not use them itself. Use them, for example, to give a material the beam length (see below).Width: The thickness of the beam geometry. The scale of the owner object also applies.MaxLength: If larger than zero, the beam is at most this long. It starts at the owner and points toward the target object or, if no target object is set, along the X axis. In the latter case, a negative value is also possible. You can then also setMaxLengthfrom code, to control the length dynamically.
Geometry and Texture Coordinates
All beam components share one small mesh: a cross of two double-sided quads, one unit long and one unit wide. At render time, the mesh is rotated toward the target and stretched to the beam length and width.
The texture coordinates are normalized: U goes from 0 at the owner to 1 at the target end, and V goes from 0 to 1 across the beam. This makes it easy to fade the beam along its length, for example with an alpha gradient that goes from 1 at U = 0 to 0 at U = 1.
A texture that repeats along the beam needs to know the beam length. The beam component does not give it to the shader. If you need this, set CustomData from code.