Garry's Mod Wiki

Garry's Mod Wiki

  ParticleEffect( string particleName, Vector position, Angle angles, Entity parent = NULL )


Creates a particle effect. See also CreateParticleSystem.

The particle effect must be precached serverside with PrecacheParticleSystem and the file its from must be added via game.AddParticles before it can be used!


1 string particleName
The name of the particle effect.
2 Vector position
The start position of the effect.
3 Angle angles
The orientation of the effect.
4 Entity parent = NULL
If set, the particle will be parented to the entity.


Example usage of the function. Precaches ExplosionCore_wall particle from particles/explosion.pcf, a Team Fortress 2 particle file.

You can then test the particle by using the particleitup console command.

You can find a list of particles inside a .pcf file using the Particle Editor Tool

game.AddParticles( "particles/explosion.pcf" ) PrecacheParticleSystem( "ExplosionCore_wall" ) if ( SERVER ) then -- A test console command to see if the particle works, spawns the particle where the player is looking at. concommand.Add( "particleitup", function( ply, cmd, args ) ParticleEffect( "ExplosionCore_wall", ply:GetEyeTrace().HitPos, Angle( 0, 0, 0 ) ) end ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...