• SWEP Problem
    3 replies, posted
Hey, so i'm about %90 done with my first ever swep and in my opinion it's coming out great! But, there is one small problem, the gun world model shows up in my crotch area! I googled around a bit and found nothing related to my problem. Here is my shared.lua if needed: [url]http://pastebin.com/255c2GL3[/url] ----------------------------------------------------------------- Screenshot if you need more info: (don't mind the NLR above my head, need to get around off my ass and fix that some day) [url]http://i.imgur.com/D13I4il.jpg[/url] ----------------------------------------------------------------- Thanks in advance!
It's an issue with your model, not your SWEP. Also, you have a typo: [code]Sound("Weapos_AK47.Single") -- Should be Weapon[/code]
That is meant to be weapos, it's a method i found so it doesn't have the CS:S AK gun sound.
The problem is that the gun isn't rigged to be used as a world model. The cheapest alternative to fixing this issue without decompiling the model and rigging is to use a system like this: [lua] function SWEP:DrawWorldModel() local hand, offset, rotate if not IsValid(self.Owner) then self:DrawModel() return end hand = self.Owner:GetAttachment(self.Owner:LookupAttachment("anim_attachment_rh")) offset = hand.Ang:Right() * -1 + hand.Ang:Forward() * 6 + hand.Ang:Up() * 0 hand.Ang:RotateAroundAxis(hand.Ang:Right(), 10) hand.Ang:RotateAroundAxis(hand.Ang:Forward(), 10) hand.Ang:RotateAroundAxis(hand.Ang:Up(), 0) self:SetRenderOrigin(hand.Pos + offset) self:SetRenderAngles(hand.Ang) self:DrawModel() if (CLIENT) then self:SetModelScale(1,1,1) end end [/lua] This might get buggy when jumping or doing other animations though.
Sorry, you need to Log In to post a reply to this thread.