Garry's Mod Wiki


  Entity util.SpriteTrail( Entity ent, number attachmentID, table color, boolean additive, number startWidth, number endWidth, number lifetime, number textureRes, string texture )


Adds a trail to the specified entity.


1 Entity ent
Entity to attach trail to
2 number attachmentID
Attachment ID of the entities model to attach trail to. If you are not sure, set this to 0
3 table color
Color of the trail, use Color
4 boolean additive
Should the trail be additive or not
5 number startWidth
Start width of the trail
6 number endWidth
End width of the trail
7 number lifetime
How long it takes to transition from startWidth to endWidth
8 number textureRes
The resolution of trails texture. A good value can be calculated using this formula: 1 / ( startWidth + endWidth ) * 0.5
9 string texture
Path to the texture to use as a trail.


1 Entity
Entity of created trail (env_spritetrail)


A console command that gives the player a red trail.

concommand.Add( "givetrail", function( ply ) local trail = util.SpriteTrail( ply, 0, Color( 255, 0, 0 ), false, 15, 1, 4, 1 / ( 15 + 1 ) * 0.5, "trails/plasma" ) print( trail ) end )