I want to draw a SWEP’s boneless worldmodel in the hands of the player wielding it but using my current methods the model will lag behind when the player is moving.
self:SetModelScale(Vector(0.5, 0.5, 0.5))
local pos, angles = self.Owner:GetBonePosition(self.Owner:LookupBone(“ValveBiped.Bip01_R_Hand”))
I have also tried Pre/PostPlayerDraw and got the same issues.
Can anyone see something wrong with my method or even suggest a better way to do it? I’m open to anything that makes it look good.
Note that I am testing in singleplayer with the camera STOOL. I don’t know if that’s relevent.
Got it, final code for those interested :
local ply = self.Owner
if !ValidEntity( ply ) then
if !self.m_hHands then self.m_hHands = ply:LookupAttachment( "anim_attachment_RH" ) end local hand = ply:GetAttachment( self.m_hHands ) self.Weapon:SetRenderOrigin( hand.Pos ) self.Weapon:SetRenderAngles( hand.Ang ) self:SetModelScale(Vector(0.5, 0.5, 0.5)) self.Weapon:DrawModel()