Get the Muzzleflash position of a weapons worldmodel?
1 replies, posted
How can I get the position of the muzzleflash of a weapons [B]worldmodel[/B] and the models current angle (like the direction of the muzzleflash)?
Thanks in advance.
This will work for HL2 worldmodels, but it's not guaranteed to for custom ones since attachment names are not unified:
[code]local pWeapon = Player:GetActiveWeapon()
local iAttachment = pWeapon:LookupAttachment("muzzle")
if (iAttachment ~= 0) then
local vPos = pWeapon:GetAttachment(iAttachment).Pos
end[/code]
Sorry, you need to Log In to post a reply to this thread.