# Sandbox.BeamEffect

The BeamEffect component creates a visual beam effect in the scene, simulating a continuous line or laser-like effect.
Unlike LineRenderer these beams can change over time, spawn multiple instances, and have various properties like color, texture, and lifetime.
This is a useful component for creating things like laser beams, energy effects and tracers.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.Component](/api/Sandbox.Component)
- Modifiers: sealed

## Constructors

- [`BeamEffect`](/api/Sandbox.BeamEffect/.ctor)

## Properties

- [`Additive`](/api/Sandbox.BeamEffect/Additive): If true, the beam is rendered additively, making it appear to glow.
- [`Alpha`](/api/Sandbox.BeamEffect/Alpha): Alpha multiplier for the beam's color. Controls transparency over the beam's lifetime.
- [`BeamColor`](/api/Sandbox.BeamEffect/BeamColor): Color gradient of the beam over its lifetime. Defines how the color changes from birth to death.
- [`BeamLifetime`](/api/Sandbox.BeamEffect/BeamLifetime): Lifetime of each beam in seconds. Determines how long a beam remains before being removed or respawned.
- [`BeamsPerSecond`](/api/Sandbox.BeamEffect/BeamsPerSecond): Number of beams spawned per second. Controls the spawn rate for continuous effects.
- [`Brightness`](/api/Sandbox.BeamEffect/Brightness): Brightness multiplier for the beam's color. Adjusts intensity over the beam's lifetime.
- [`DepthFeather`](/api/Sandbox.BeamEffect/DepthFeather): Amount of feathering applied to the beam's depth, softening its intersection with geometry.
- [`FilterMode`](/api/Sandbox.BeamEffect/FilterMode): Controls texture filtering on this beam effect.
- [`FollowPoints`](/api/Sandbox.BeamEffect/FollowPoints): If true, the beam endpoints follow their source and target positions each frame, updating dynamically.
- [`InitialBurst`](/api/Sandbox.BeamEffect/InitialBurst): Number of beams spawned immediately when the effect is enabled.
- [`Lighting`](/api/Sandbox.BeamEffect/Lighting): If true, the beam is affected by scene lighting.
- [`Looped`](/api/Sandbox.BeamEffect/Looped): If true, beams respawn automatically when they expire, creating a looping effect.
- [`Material`](/api/Sandbox.BeamEffect/Material): Material applied to the beam. Defines the visual appearance along the beam's length. The material should be based on the `line.shader`.
- [`MaxBeams`](/api/Sandbox.BeamEffect/MaxBeams): Maximum number of beams that can exist at once. Limits the total active beams.
- [`Opaque`](/api/Sandbox.BeamEffect/Opaque): If true, the beam is rendered as opaque rather than transparent.
- [`Scale`](/api/Sandbox.BeamEffect/Scale): Thickness of the beam in world units. Controls how wide the beam appears.
- [`Shadows`](/api/Sandbox.BeamEffect/Shadows): If true, the beam casts shadows in the scene.
- [`TargetGameObject`](/api/Sandbox.BeamEffect/TargetGameObject): GameObject to target with the beam. If assigned, overrides TargetPosition and uses the object's world position as the endpoint.
- [`TargetPosition`](/api/Sandbox.BeamEffect/TargetPosition): World position the beam targets if no target object is set. Used as the endpoint for the beam.
- [`TargetRandom`](/api/Sandbox.BeamEffect/TargetRandom): Random offset applied to the target position for visual variation. Adds randomness to the endpoint.
- [`Texture`](/api/Sandbox.BeamEffect/Texture): Texture applied to the beam. Defines the visual appearance along the beam's length.
- [`TextureOffset`](/api/Sandbox.BeamEffect/TextureOffset): Offset of the texture along the beam. Shifts the texture start position.
- [`TextureScale`](/api/Sandbox.BeamEffect/TextureScale): Scale of the texture along the beam. Controls how many world units each texture tile covers.
- [`TextureScroll`](/api/Sandbox.BeamEffect/TextureScroll): This is pretty much the same as TextureOffset - but it's seperate so you can use offset for offset, and scroll to scroll.
- [`TextureScrollSpeed`](/api/Sandbox.BeamEffect/TextureScrollSpeed): Speed at which the texture scrolls along the beam. Positive values scroll in one direction, negative in the other.
- [`TravelBetweenPoints`](/api/Sandbox.BeamEffect/TravelBetweenPoints): If true, the beam visually travels from start to end, useful for tracer effects.
- [`TravelLerp`](/api/Sandbox.BeamEffect/TravelLerp): Controls the interpolation of the beam's travel effect over its lifetime.

## Methods

- [`SetStartPoint`](/api/Sandbox.BeamEffect/SetStartPoint): [Sandbox.ITargetedEffect](/api/Sandbox.ITargetedEffect): where the beam starts from.
- [`SetTarget`](/api/Sandbox.BeamEffect/SetTarget): [Sandbox.ITargetedEffect](/api/Sandbox.ITargetedEffect): aim the beam - at the anchor's object when it has one, so the beam follows it, otherwise at the fixed position.
- [`SpawnBeam`](/api/Sandbox.BeamEffect/SpawnBeam): Spawns a new beam and adds it to the effect.
