Trying to make an hat mod.

Hey facepunch I would like to make an hat mod now I wanted to know if theres any easy way to attach an entity to the player maybe theres a function that I dont aware of?

**[Entity.LookupBone](** and **[Entity.SetAttachment](**

You could also give your hat model a bone named ValveBiped.Bip01_Head1 and then Set the parent of your hat model to the player using Entity.SetParent, then do Entity.AddEffects( EF_BONEMERGE ).

This is pretty much how the engine does it with Weapons. However, note that if you do it this way it’s usually permanent until the parent entity is gone.

This method is probably better if you’re making your own hat models.