BeamEffectclass

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.

objectComponentBeamEffect
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.BeamEffect : Sandbox.Component

Constructors1

Showing 1 constructors

Methods1

Showing 1 methods

Properties27

Showing 27 properties

public bool Sandbox.BeamEffect.Additive { get; set; }PUBLICGETSET

If true, the beam is rendered additively, making it appear to glow.

Returns:bool

public Sandbox.ParticleFloat Sandbox.BeamEffect.Alpha { get; set; }PUBLICGETSET

Alpha multiplier for the beam's color. Controls transparency over the beam's lifetime.

Returns:ParticleFloat

public Sandbox.ParticleFloat Sandbox.BeamEffect.BeamLifetime { get; set; }PUBLICGETSET

Lifetime of each beam in seconds. Determines how long a beam remains before being removed or respawned.

Returns:ParticleFloat

public float Sandbox.BeamEffect.BeamsPerSecond { get; set; }PUBLICGETSET

Number of beams spawned per second. Controls the spawn rate for continuous effects.

Returns:float

public Sandbox.ParticleFloat Sandbox.BeamEffect.Brightness { get; set; }PUBLICGETSET

Brightness multiplier for the beam's color. Adjusts intensity over the beam's lifetime.

Returns:ParticleFloat

public float Sandbox.BeamEffect.DepthFeather { get; set; }PUBLICGETSET

Amount of feathering applied to the beam's depth, softening its intersection with geometry.

Returns:float

public Sandbox.Rendering.FilterMode Sandbox.BeamEffect.FilterMode { get; set; }PUBLICGETSET

Controls texture filtering on this beam effect.

Returns:FilterMode

public bool Sandbox.BeamEffect.FollowPoints { get; set; }PUBLICGETSET

If true, the beam endpoints follow their source and target positions each frame, updating dynamically.

Returns:bool

public int Sandbox.BeamEffect.InitialBurst { get; set; }PUBLICGETSET

Number of beams spawned immediately when the effect is enabled.

Returns:int

public bool Sandbox.BeamEffect.Lighting { get; set; }PUBLICGETSET

If true, the beam is affected by scene lighting.

Returns:bool

public bool Sandbox.BeamEffect.Looped { get; set; }PUBLICGETSET

If true, beams respawn automatically when they expire, creating a looping effect.

Returns:bool

public Sandbox.Material Sandbox.BeamEffect.Material { get; set; }PUBLICGETSET

Material applied to the beam. Defines the visual appearance along the beam's length. The material should be based on the `line.shader`.

Returns:Material

public int Sandbox.BeamEffect.MaxBeams { get; set; }PUBLICGETSET

Maximum number of beams that can exist at once. Limits the total active beams.

Returns:int

public bool Sandbox.BeamEffect.Opaque { get; set; }PUBLICGETSET

If true, the beam is rendered as opaque rather than transparent.

Returns:bool

public bool Sandbox.BeamEffect.Shadows { get; set; }PUBLICGETSET

If true, the beam casts shadows in the scene.

Returns:bool

public Sandbox.GameObject Sandbox.BeamEffect.TargetGameObject { get; set; }PUBLICGETSET

GameObject to target with the beam. If assigned, overrides TargetPosition and uses the object's world position as the endpoint.

Returns:GameObject

public Vector3 Sandbox.BeamEffect.TargetPosition { get; set; }PUBLICGETSET

World position the beam targets if no target object is set. Used as the endpoint for the beam.

Returns:Vector3

public Vector3 Sandbox.BeamEffect.TargetRandom { get; set; }PUBLICGETSET

Random offset applied to the target position for visual variation. Adds randomness to the endpoint.

Returns:Vector3

public Sandbox.Texture Sandbox.BeamEffect.Texture { get; set; }PUBLICGETSETOBSOLETE

Texture applied to the beam. Defines the visual appearance along the beam's length.

Obsolete: Use Material instead

Returns:Texture

public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureOffset { get; set; }PUBLICGETSET

Offset of the texture along the beam. Shifts the texture start position.

Returns:ParticleFloat

public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScale { get; set; }PUBLICGETSET

Scale of the texture along the beam. Controls how many world units each texture tile covers.

Returns:ParticleFloat

public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScroll { get; set; }PUBLICGETSET

This is pretty much the same as TextureOffset - but it's seperate so you can use offset for offset, and scroll to scroll.

Returns:ParticleFloat

public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScrollSpeed { get; set; }PUBLICGETSET

Speed at which the texture scrolls along the beam. Positive values scroll in one direction, negative in the other.

Returns:ParticleFloat

public bool Sandbox.BeamEffect.TravelBetweenPoints { get; set; }PUBLICGETSET

If true, the beam visually travels from start to end, useful for tracer effects.

Returns:bool

public Sandbox.ParticleFloat Sandbox.BeamEffect.TravelLerp { get; set; }PUBLICGETSET

Controls the interpolation of the beam's travel effect over its lifetime.

Returns:ParticleFloat

On this page

Constructorspublic BeamEffect()Methodspublic Sandbox.BeamEffect.BeamInstance SpawnBeam()Propertiespublic System.Boolean Sandbox.BeamEffect.Additive { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.Alpha { get; set; }public Sandbox.ParticleGradient Sandbox.BeamEffect.BeamColor { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.BeamLifetime { get; set; }public System.Single Sandbox.BeamEffect.BeamsPerSecond { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.Brightness { get; set; }public System.Single Sandbox.BeamEffect.DepthFeather { get; set; }public Sandbox.Rendering.FilterMode Sandbox.BeamEffect.FilterMode { get; set; }public System.Boolean Sandbox.BeamEffect.FollowPoints { get; set; }public System.Int32 Sandbox.BeamEffect.InitialBurst { get; set; }public System.Boolean Sandbox.BeamEffect.Lighting { get; set; }public System.Boolean Sandbox.BeamEffect.Looped { get; set; }public Sandbox.Material Sandbox.BeamEffect.Material { get; set; }public System.Int32 Sandbox.BeamEffect.MaxBeams { get; set; }public System.Boolean Sandbox.BeamEffect.Opaque { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.Scale { get; set; }public System.Boolean Sandbox.BeamEffect.Shadows { get; set; }public Sandbox.GameObject Sandbox.BeamEffect.TargetGameObject { get; set; }public Vector3 Sandbox.BeamEffect.TargetPosition { get; set; }public Vector3 Sandbox.BeamEffect.TargetRandom { get; set; }public Sandbox.Texture Sandbox.BeamEffect.Texture { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureOffset { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScale { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScroll { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScrollSpeed { get; set; }public System.Boolean Sandbox.BeamEffect.TravelBetweenPoints { get; set; }public Sandbox.ParticleFloat Sandbox.BeamEffect.TravelLerp { get; set; }Metadata