I can't seem to figure out how to add RunSights to a SWEP that I am making. Any help? I try to ask my friend but he always says he is busy but he knows how.
Thanks for the help. :D (If any.)
Code that I have so far:
[CODE]
SWEP.RunSightsPos = Vector(0, 0, 6.377)
SWEP.RunSightsAng = Vector(-26.181, 0, 0)
function SWEP:GetViewModelPosition(pos, ang)
if SERVER then return Vector(0,0,0), Angle(0,0,0) end
--reposition the weapon when you run, adding more realism to the base.
local RunPos = self.RunSightsPos
local RunAng = self.RunSightsAng
if RunAng then
ang = ang * 1
ang:RotateAroundAxis (ang:Right(), RunAng.x)
ang:RotateAroundAxis (ang:Up(), RunAng.y)
ang:RotateAroundAxis (ang:Forward(), RunAng.z)
end
if RunPos then
local Right = ang:Right()
local Up = ang:Up()
local Forward = ang:Forward()
pos = pos + RunPos.x * Right
pos = pos + RunPos.y * Forward
pos = pos + RunPos.z * Up
end
[/CODE]
Sorry, you need to Log In to post a reply to this thread.