ParticleEffectclass

Defines and holds particles. This is the core of the particle system.

objectComponentParticleEffect
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.ParticleEffect : Sandbox.Component

Constructors1

Showing 1 constructors

Methods7

Showing 7 methods

public void Clear()PUBLIC

Returns:void

public void ResetEmitters()PUBLIC

Returns:void

public void Step(float timeDelta)PUBLIC

ParameterTypeDescription
timeDeltafloat
Returns:void

public void Terminate(Sandbox.Particle p)PUBLIC

ParameterTypeDescription
pParticle
Returns:void

Properties66

Showing 66 properties

public bool Sandbox.ParticleEffect.ApplyAlpha { get; set; }PUBLICGETSET

Enables or disables alpha application for particles.

Returns:bool

public bool Sandbox.ParticleEffect.ApplyColor { get; set; }PUBLICGETSET

Enables or disables color application for particles.

Returns:bool

public bool Sandbox.ParticleEffect.ApplyRotation { get; set; }PUBLICGETSET

Enables or disables rotation for particles.

Returns:bool

public bool Sandbox.ParticleEffect.ApplyShape { get; set; }PUBLICGETSET

Enables or disables shape application for particles.

Returns:bool

public bool Sandbox.ParticleEffect.Collision { get; set; }PUBLICGETSET

Enables or disables collision behavior for particles.

Returns:bool

public Sandbox.TagSet Sandbox.ParticleEffect.CollisionIgnore { get; set; }PUBLICGETSET

The set of tags to ignore during collision detection.

Returns:TagSet

public System.Collections.Generic.List`1<Sandbox.GameObject> Sandbox.ParticleEffect.CollisionPrefab { get; set; }PUBLICGETSET

Will choose a random prefab to spawn from this list.

Returns:List<GameObject>

public bool Sandbox.ParticleEffect.CollisionPrefabAlign { get; set; }PUBLICGETSET

When true the collision prefab will be aligned with the surface it collides with.

Returns:bool

public Sandbox.ParticleFloat Sandbox.ParticleEffect.CollisionPrefabChance { get; set; }PUBLICGETSET

If 1 then we'll always spawn a prefab. If 0.5 then we'll spawn a prefab 50% of the time.

Returns:ParticleFloat

public Sandbox.ParticleFloat Sandbox.ParticleEffect.CollisionPrefabRotation { get; set; }PUBLICGETSET

We will by default align to the particle's angle, but we can also randomize that.

Returns:ParticleFloat

public float Sandbox.ParticleEffect.CollisionRadius { get; set; }PUBLICGETSET

The radius used for collision detection.

Returns:float

public virtual int Sandbox.ParticleEffect.ComponentVersion { get; set; }PUBLICVIRTUALGETSET

Returns:int

public Sandbox.ParticleFloat Sandbox.ParticleEffect.Damping { get; set; }PUBLICGETSET

The damping factor applied to particle velocity over time. This reduces the velocity of particles, simulating resistance or drag.

Returns:ParticleFloat

public System.Collections.Generic.List`1<Sandbox.Particle> Sandbox.ParticleEffect.DelayedParticles { get; set; }PUBLICGETSET

Delayed particles in the effect. Delayed particles are those that have been emitted but are waiting to be activated based on their start delay.

Returns:List<Particle>

public System.Collections.Generic.List`1<Sandbox.GameObject> Sandbox.ParticleEffect.FollowerPrefab { get; set; }PUBLICGETSET

Will choose a random prefab to spawn from this list.

Returns:List<GameObject>

public Sandbox.ParticleFloat Sandbox.ParticleEffect.FollowerPrefabChance { get; set; }PUBLICGETSET

If 1 then we'll always spawn a prefab. If 0.5 then we'll spawn a prefab 50% of the time.

Returns:ParticleFloat

public bool Sandbox.ParticleEffect.FollowerPrefabKill { get; set; }PUBLICGETSET

When true the prefab will be destroyed at the end of the particle's life.

Returns:bool

public bool Sandbox.ParticleEffect.Force { get; set; }PUBLICGETSET

Enables or disables the application of forces to particles.

Returns:bool

public Vector3 Sandbox.ParticleEffect.ForceDirection { get; set; }PUBLICGETSET

The direction of the force applied to particles.

Returns:Vector3

public Sandbox.ParticleFloat Sandbox.ParticleEffect.ForceScale { get; set; }PUBLICGETSET

The scale of the force applied to each particle. This multiplier determines the intensity of the force applied to particles.

Returns:ParticleFloat

public Sandbox.ParticleVector3 Sandbox.ParticleEffect.InitialVelocity { get; set; }PUBLICGETSET

The initial velocity of the particle when it is created. This is applied before any forces are applied.

Returns:ParticleVector3

public bool Sandbox.ParticleEffect.IsFull { get; set; }PUBLICGETSET

Whether the particle effect has reached its maximum capacity. This is determined by comparing the total particle count to the `Sandbox.ParticleEffect.MaxParticles` property.

Returns:bool

public Sandbox.ParticleFloat Sandbox.ParticleEffect.LocalSpace { get; set; }PUBLICGETSET

When 1 particles will be moved in local space relative to the emitter GameObject's transform. This allows particles to be emitted in a local space, like a fire effect that moves with the player, but the particles can slowly move to world space.

Returns:ParticleFloat

public int Sandbox.ParticleEffect.MaxParticles { get; set; }PUBLICGETSET

The maximum number of particles that can exist in this effect at once.

Returns:int

public float Sandbox.ParticleEffect.MaxParticleSize { get; set; }PUBLICGETSET

The size of the largest particle in the effect. This is determined by the maximum scale of any particle along its x, y, or z axis.

Returns:float

public System.Action`1<Sandbox.Particle> Sandbox.ParticleEffect.OnParticleCreated { get; set; }PUBLICGETSET

Called any time a particle is created.

Returns:Action<Particle>

public System.Action`1<Sandbox.Particle> Sandbox.ParticleEffect.OnParticleDestroyed { get; set; }PUBLICGETSETLIFECYCLE

Called any time a particle is destroyed.

Returns:Action<Particle>

public System.Action`1<float> Sandbox.ParticleEffect.OnPostStep { get; set; }PUBLICGETSET

Called after the particles are stepped. This allows custom logic to be executed after the simulation advances.

Returns:Action<float>

public System.Action`1<float> Sandbox.ParticleEffect.OnPreStep { get; set; }PUBLICGETSET

Called before the particles are stepped. This allows custom logic to be executed before the simulation advances.

Returns:Action<float>

public System.Action`2<Sandbox.Particle,float> Sandbox.ParticleEffect.OnStep { get; set; }PUBLICGETSET

Called after each particle is stepped. This provides an opportunity to modify individual particles during the simulation.

Returns:Action<Particle,float>

public BBox Sandbox.ParticleEffect.ParticleBounds { get; set; }PUBLICGETSET

The bounding box that encompasses all active particles. This is useful for determining the spatial extent of the particle effect.

Returns:BBox

public int Sandbox.ParticleEffect.ParticleCount { get; set; }PUBLICGETSET

The total number of particles in the effect, including both active and delayed particles.

Returns:int

public System.Collections.Generic.List`1<Sandbox.Particle> Sandbox.ParticleEffect.Particles { get; set; }PUBLICGETSET

Active particles in the effect. Active particles are those currently being simulated and rendered.

Returns:List<Particle>

public bool Sandbox.ParticleEffect.Paused { get; set; }PUBLICGETSET

Whether the particle simulation is currently paused. When paused, particles will not update their positions, velocities, or other properties.

Returns:bool

public Sandbox.ParticleFloat Sandbox.ParticleEffect.PerParticleTimeScale { get; set; }PUBLICGETSET

Per-particle time scale multiplier. Allows each particle to have a unique simulation speed.

Returns:ParticleFloat

public float Sandbox.ParticleEffect.PreWarm { get; set; }PUBLICGETSET

How many seconds to pre-warm this effect by when creating.

Returns:float

public bool Sandbox.ParticleEffect.SheetSequence { get; set; }PUBLICGETSET

Enables or disables the use of a sheet sequence for particles.

Returns:bool

public bool Sandbox.ParticleEffect.SnapToFrame { get; set; }PUBLICGETSET

When enabled, snap to the nearest whole frame instead of blending between frames.

Returns:bool

public Sandbox.ParticleFloat Sandbox.ParticleEffect.StartVelocity { get; set; }PUBLICGETSET

Apply an element of random velocity to the particle when it is created, in a random direction.

Returns:ParticleFloat

public float Sandbox.ParticleEffect.TimeScale { get; set; }PUBLICGETSET

Scales the simulation time for this effect.

Returns:float

public bool Sandbox.ParticleEffect.UsePrefabFeature { get; set; }PUBLICGETSET

Enables or disables the use of prefabs for particles.

Returns:bool

On this page

Constructorspublic ParticleEffect()Methodspublic System.Void Clear()public Sandbox.Particle Emit(Vector3 position, System.Single delta, Sandbox.SkinnedModelRenderer attachTarget, System.Int32 boneIndex)public Sandbox.Particle Emit(Vector3 position, System.Single delta)public Sandbox.Particle Emit(Vector3 position)public System.Void ResetEmitters()public System.Void Step(System.Single timeDelta)public System.Void Terminate(Sandbox.Particle p)Propertiespublic Sandbox.ParticleFloat Sandbox.ParticleEffect.Alpha { get; set; }public System.Boolean Sandbox.ParticleEffect.ApplyAlpha { get; set; }public System.Boolean Sandbox.ParticleEffect.ApplyColor { get; set; }public System.Boolean Sandbox.ParticleEffect.ApplyRotation { get; set; }public System.Boolean Sandbox.ParticleEffect.ApplyShape { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Bounce { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Brightness { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Bumpiness { get; set; }public System.Boolean Sandbox.ParticleEffect.Collision { get; set; }public Sandbox.TagSet Sandbox.ParticleEffect.CollisionIgnore { get; set; }public System.Collections.Generic.List`1<Sandbox.GameObject> Sandbox.ParticleEffect.CollisionPrefab { get; set; }public System.Boolean Sandbox.ParticleEffect.CollisionPrefabAlign { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.CollisionPrefabChance { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.CollisionPrefabRotation { get; set; }public System.Single Sandbox.ParticleEffect.CollisionRadius { get; set; }public virtual System.Int32 Sandbox.ParticleEffect.ComponentVersion { get; set; }public Sandbox.ParticleVector3 Sandbox.ParticleEffect.ConstantMovement { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Damping { get; set; }public System.Collections.Generic.List`1<Sandbox.Particle> Sandbox.ParticleEffect.DelayedParticles { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.DieOnCollisionChance { get; set; }public System.Collections.Generic.List`1<Sandbox.GameObject> Sandbox.ParticleEffect.FollowerPrefab { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.FollowerPrefabChance { get; set; }public System.Boolean Sandbox.ParticleEffect.FollowerPrefabKill { get; set; }public System.Boolean Sandbox.ParticleEffect.Force { get; set; }public Vector3 Sandbox.ParticleEffect.ForceDirection { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.ForceScale { get; set; }public Sandbox.ParticleEffect.SimulationSpace Sandbox.ParticleEffect.ForceSpace { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Friction { get; set; }public Sandbox.ParticleGradient Sandbox.ParticleEffect.Gradient { get; set; }public Sandbox.ParticleVector3 Sandbox.ParticleEffect.InitialVelocity { get; set; }public System.Boolean Sandbox.ParticleEffect.IsFull { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Lifetime { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.LocalSpace { get; set; }public System.Int32 Sandbox.ParticleEffect.MaxParticles { get; set; }public System.Single Sandbox.ParticleEffect.MaxParticleSize { get; set; }public System.Action`1<Sandbox.Particle> Sandbox.ParticleEffect.OnParticleCreated { get; set; }public System.Action`1<Sandbox.Particle> Sandbox.ParticleEffect.OnParticleDestroyed { get; set; }public System.Action`1<System.Single> Sandbox.ParticleEffect.OnPostStep { get; set; }public System.Action`1<System.Single> Sandbox.ParticleEffect.OnPreStep { get; set; }public System.Action`2<Sandbox.Particle,System.Single> Sandbox.ParticleEffect.OnStep { get; set; }public Sandbox.ParticleVector3 Sandbox.ParticleEffect.OrbitalForce { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.OrbitalPull { get; set; }public BBox Sandbox.ParticleEffect.ParticleBounds { get; set; }public System.Int32 Sandbox.ParticleEffect.ParticleCount { get; set; }public System.Collections.Generic.List`1<Sandbox.Particle> Sandbox.ParticleEffect.Particles { get; set; }public System.Boolean Sandbox.ParticleEffect.Paused { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.PerParticleTimeScale { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Pitch { get; set; }public System.Single Sandbox.ParticleEffect.PreWarm { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.PushStrength { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Roll { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Scale { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.SequenceId { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.SequenceSpeed { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.SequenceTime { get; set; }public System.Boolean Sandbox.ParticleEffect.SheetSequence { get; set; }public System.Boolean Sandbox.ParticleEffect.SnapToFrame { get; set; }public Sandbox.ParticleEffect.SimulationSpace Sandbox.ParticleEffect.Space { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.StartDelay { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.StartVelocity { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Stretch { get; set; }public System.Single Sandbox.ParticleEffect.TimeScale { get; set; }public Sandbox.ParticleEffect.TimingMode Sandbox.ParticleEffect.Timing { get; set; }public Color Sandbox.ParticleEffect.Tint { get; set; }public System.Boolean Sandbox.ParticleEffect.UsePrefabFeature { get; set; }public Sandbox.ParticleFloat Sandbox.ParticleEffect.Yaw { get; set; }Metadata