public sealed class Sandbox.BeamEffect : Sandbox.Component
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.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 1 constructors
public BeamEffect()
No results match this filter.
Methods
Showing 1 methods
public Sandbox.BeamEffect.BeamInstance SpawnBeam()
Spawns a new beam and adds it to the effect.
No results match this filter.
Properties
Showing 27 properties
public bool Sandbox.BeamEffect.Additive { get; set; }
If true, the beam is rendered additively, making it appear to glow.
public Sandbox.ParticleFloat Sandbox.BeamEffect.Alpha { get; set; }
Alpha multiplier for the beam's color. Controls transparency over the beam's lifetime.
public Sandbox.ParticleGradient Sandbox.BeamEffect.BeamColor { get; set; }
Color gradient of the beam over its lifetime. Defines how the color changes from birth to death.
public Sandbox.ParticleFloat Sandbox.BeamEffect.BeamLifetime { get; set; }
Lifetime of each beam in seconds. Determines how long a beam remains before being removed or respawned.
public float Sandbox.BeamEffect.BeamsPerSecond { get; set; }
Number of beams spawned per second. Controls the spawn rate for continuous effects.
public Sandbox.ParticleFloat Sandbox.BeamEffect.Brightness { get; set; }
Brightness multiplier for the beam's color. Adjusts intensity over the beam's lifetime.
public float Sandbox.BeamEffect.DepthFeather { get; set; }
Amount of feathering applied to the beam's depth, softening its intersection with geometry.
public Sandbox.Rendering.FilterMode Sandbox.BeamEffect.FilterMode { get; set; }
Controls texture filtering on this beam effect.
public bool Sandbox.BeamEffect.FollowPoints { get; set; }
If true, the beam endpoints follow their source and target positions each frame, updating dynamically.
public int Sandbox.BeamEffect.InitialBurst { get; set; }
Number of beams spawned immediately when the effect is enabled.
public bool Sandbox.BeamEffect.Lighting { get; set; }
If true, the beam is affected by scene lighting.
public bool Sandbox.BeamEffect.Looped { get; set; }
If true, beams respawn automatically when they expire, creating a looping effect.
public Sandbox.Material Sandbox.BeamEffect.Material { get; set; }
Material applied to the beam. Defines the visual appearance along the beam's length. The material should be based on the `line.shader`.
public int Sandbox.BeamEffect.MaxBeams { get; set; }
Maximum number of beams that can exist at once. Limits the total active beams.
public bool Sandbox.BeamEffect.Opaque { get; set; }
If true, the beam is rendered as opaque rather than transparent.
public Sandbox.ParticleFloat Sandbox.BeamEffect.Scale { get; set; }
Thickness of the beam in world units. Controls how wide the beam appears.
public bool Sandbox.BeamEffect.Shadows { get; set; }
If true, the beam casts shadows in the scene.
public Sandbox.GameObject Sandbox.BeamEffect.TargetGameObject { get; set; }
GameObject to target with the beam. If assigned, overrides TargetPosition and uses the object's world position as the endpoint.
public Vector3 Sandbox.BeamEffect.TargetPosition { get; set; }
World position the beam targets if no target object is set. Used as the endpoint for the beam.
public Vector3 Sandbox.BeamEffect.TargetRandom { get; set; }
Random offset applied to the target position for visual variation. Adds randomness to the endpoint.
public Sandbox.Texture Sandbox.BeamEffect.Texture { get; set; }Obsolete
Texture applied to the beam. Defines the visual appearance along the beam's length.
Obsolete: Use Material instead
public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureOffset { get; set; }
Offset of the texture along the beam. Shifts the texture start position.
public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScale { get; set; }
Scale of the texture along the beam. Controls how many world units each texture tile covers.
public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScroll { get; set; }
This is pretty much the same as TextureOffset - but it's seperate so you can use offset for offset, and scroll to scroll.
public Sandbox.ParticleFloat Sandbox.BeamEffect.TextureScrollSpeed { get; set; }
Speed at which the texture scrolls along the beam. Positive values scroll in one direction, negative in the other.
public bool Sandbox.BeamEffect.TravelBetweenPoints { get; set; }
If true, the beam visually travels from start to end, useful for tracer effects.
public Sandbox.ParticleFloat Sandbox.BeamEffect.TravelLerp { get; set; }
Controls the interpolation of the beam's travel effect over its lifetime.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.BeamEffect |