Hello, i just added a world model to my Wakizashi Swep, but the problem is, the w_wakizashi is completely in the wrong position. at this point, its stabbing into my pelvis, with the handle by my ankles. Should i recompile the w_wakizashi, adjusting the "$origin 0 0 0" code, or is there another way, where i can move its position, with out having to recompile my .mdl?
thanks!
[code]SWEP.Offset = {
Pos = {
Up = 0,
Right = 0,
Forward = 0,
},
Ang = {
Up = 0,
Right = 0,
Forward = 0,
}
}
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[/code]
Play with the angles and then figure the position once it is oriented the correct way.
Sorry, you need to Log In to post a reply to this thread.