Hey, I basically want to attach an entity (hats, etc.) to a player’s bone but I cant figure out why the entity spawns with an offset if I look at another direction than the direction I aligned the entity to the bone. (http://imgur.com/a/nwnuI)
Edit: Exept of that everytime it spawns it has a little and always different offset. Thaty pretty annoying.
function AddAccessoryHat(player, model, AngOffset, PosOffset) player:SetEyeAngles(Angle(11.912, 89.791, 0.000)) -- temporary and ineffective attempt to fix it timer.Simple(0.5,function() if IsValid(accessory) then accessory:Remove() end local bPos, bAng = player:GetBonePosition(7) accessory = ents.Create("prop_dynamic") accessory:SetParent( player ) accessory:SetModel( model ) accessory:SetPos( bPos + PosOffset) accessory:SetAngles(bAng + AngOffset) player:DeleteOnRemove( accessory ) accessory:Fire("setparentattachmentmaintainoffset", "anim_attachment_head", 0.01 ) end) end