Skip to content

Particle

The Particle class provides helpers for creating and updating particle instances.


Methods

static CreateCircle(particle: Particle | null, position: Vector | Entity, radius: number)Particle

Creates a circle particle (green circle).

  • particleParticle | null - The particle to update position. If null, a new particle will be created.
  • positionVector | Entity - The position or entity to create the circle at.
  • radiusnumber - The radius of the circle.

IMPORTANT

Using "particles/ui_mouseactions/range_display.vpcf" particle. Cant change the radius of the particle after creation.

Returned:

  • Particle - A Particle object representing the circle.

static CreateColoredCircle(particle: Particle | null, position: Vector | Entity, radius: number, color: Color, dashAlpha: number)Particle

Creates a colored circle particle.

  • particleParticle | null - The particle to create the colored circle from. Can be null.
  • positionVector | Entity - The position or entity to create the colored circle at.
  • radiusnumber - The radius of the circle.
  • colorColor - The color of the circle.
  • dashAlphanumber - The alpha value for the dash.

IMPORTANT

Using "particles/ui_mouseactions/drag_selected_ring.vpcf" particle. Cant change the radius and color of the particle after creation.

Returned:

  • Particle - A Particle object representing the colored circle.

static Create(particlePath: string, attachmentType: Enum.ParticleAttachment, attachmentEntity?: Entity | null)Particle

Creates a new particle.

  • particlePathstring - The path of the particle. like "particles/ui_mouseactions/range_display.vpcf"
  • attachmentTypeEnum.ParticleAttachment - The type of attachment for the particle.
  • attachmentEntityEntity | null (optional) - The entity to attach the particle to. Optional.

Returned:


static GetParticleName(nameIndex: bigint)string

Retrieves the particle name for the specified name index.

  • nameIndexbigint - The particle name index.

Returned:

  • string - The requested particle name.

SetControl(controlIndex: number, vector: Vector)void

Sets the control of a particle.

  • controlIndexnumber - The index of the control.
  • vectorVector - The vector to set the control to.

Destroy(immediate?: boolean)void

Destroys a particle.

  • immediateboolean (optional) - Whether to destroy the particle immediately. Defaults to true.