Garry's Mod Wiki

Garry's Mod Wiki

  Vector WEAPON:GetTracerOrigin()

Description

Allows you to override where the tracer effect comes from. ( Visual bullets )

Returns

1 Vector
The new position to start tracer effect from

Example

Alternating muzzle flash position for dual wield gun, with view model and 3rd person view support.

function SWEP:GetTracerOrigin() local Owner = self:GetOwner() local ent = Owner:ShouldDrawLocalPlayer() and self or Owner:GetViewModel() if ( self.Tracer ) then self.Tracer = false local att = ent:GetAttachment( ent:LookupAttachment( "muzzle" ) ) or ent:GetAttachment( ent:LookupAttachment( "1" ) ) return att.Pos else self.Tracer = true local att = ent:GetAttachment( ent:LookupAttachment( "muzzle2" ) ) or ent:GetAttachment( ent:LookupAttachment( "2" ) ) return att.Pos 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...