So I’m making a riot shield SWEP and to stop bullets I’m spawning a prop when the SWEP is deployed and positioning it according to the player’s head. Here’s the code:
if CLIENT then return end
if !self.RiotShield then return end
local Head = self.Owner:LookupBone("ValveBiped.Bip01_Head1") if !Head then return end local Pos, Ang = self.Owner:GetBonePosition( Head ) self.RiotShield:SetPos( Pos ) Ang:RotateAroundAxis(ang:Right(), 0) Ang:RotateAroundAxis(ang:Up(), 180) self.RiotShield:SetAngles( Ang )
It positions, but it is positioning as if it was going off of my eye angles, and not my player model’s head. Like, if I look up all the way, the shield is behind me, and if I look down all the way, the shield is in my feet.
How would I fix this?