Parenting a clientside model to your head

Basically, the title, i’m kinda stuck, i’ve made the model fine, set it’s angles and set it’s position, but whenever i parent it, it rotates around the feet of my player.

Anyone?

-snip-

Disable the normal rendering ( cmodel:SetNoDraw( true ) ).
Set the position and angles yourself ( cmodel:SetPos( vec ), cmodel:SetAngles( ang ) ).
Tell it to render ( cmodel:DrawModel( ) ).

That’s how I do it and it works for me.

-snip-

Yeah, i don’t think you understand(no offence), so heres a video of where it all goes wrong

(There are so many barrels from the different attempts, all result in the same pivot-around-base effect.)
These media tags hate me

Looks like you got a problem putting them into position

[editline]07:03PM[/editline]

You can just screw parenting and use SetPos and SetAngles as Kogitsune, lookup bones on the wiki

The head has boneID 6 on playermodels:angel:

Bah. I’m confused :c. I set its pos and shiz without parenting it and it spawns, and doesn’t move with the player :C bawww

Try calling :SetupBones() between positioning it and drawing it.

Yep, same error, doesn’t move with the player.

Wait, you’re doing it in a renderhook right? D:

Wait what. What’s a renderhook? :c I’m useless.
I got it working by using a think hook, but it likes to lag behind my player when i run.

Show us some code and we might be able to help

I don’t really need help with the code now, I’m just wondering what a render hook is.

It’s where rendering is done:downs:

“PostDrawOpaqueRenderables” is a good hook to use imo, try it instead of think and it shouldn’t lag behind:3:

Don’t you mean “shouldn’t”?
:c

I wrote that:ninja:

Lagging behind again >:C

Code
[lua]

LocalPlayer().Hat = “models/Combine_Helicopter/helicopter_bomb01.mdl”
hat = ents.Create(“prop_physics”)
hat.Owner = LocalPlayer()

hat:SetModel(LocalPlayer().Hat)
hat:SetNoDraw(true)
hook.Add(“PostDrawOpaqueRenderables”,“kay”,function()

attp, atta = LocalPlayer():GetBonePosition( 6 )
attp, atta = LocalToWorld( Vector(10,0,0), Angle(0,90,90), attp, atta );
hat:SetPos( attp )
hat:SetAngles(atta)
hat:SetNoDraw(false)

end)
[/lua]

Anyone?