I am having problems with a weapon floating after it is dropped. This is for TTT. The problem is not css being mounted as it is only for one weapon and not every weapon.
The weird thing is that the weapon appears to drop correctly for the person that dropped it but it appears to float in mid-air for others.
The problem lies with the DrawWorldModel function I believe. I think for some reason it isn’t invalidating/nil the owner quick enough for other players. Here is the code.
Any help or ideas would be appreciated.
function SWEP:DrawWorldModel( ) local hand, offset, rotate if not IsValid( self.Owner ) then self:DrawModel( ) return end if not self.Hand then self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" ) end hand = self.Owner:GetAttachment( self.Hand ) if not hand then self:DrawModel( ) return end offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right ) hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward ) hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up ) self:SetRenderOrigin( hand.Pos + offset ) self:SetRenderAngles( hand.Ang ) self:DrawModel( ) end