EF_BONEMERGE Help

I have been trying to figure out how to make a prop follow the animations of a character when applied. I have tried compiling the prop into a player model and just parenting it to the pelvis bone, but this did not make it follow the animations. Wraithcat helped me figuire out I need to do use “bonemerge”, but now I am lost with what the rules and exceptions are. So I am guessing the prop has to be a ragdoll, or a npc in order to bind to a player model. I did manage to get the prop in the map, but it was not merged to the player. It was just stuck in the middle of the map floating in the air. Here is the code I used:


	local e = ents.Create("prop_physics")
	e:SetModel("models/g_belt/g_belt.mdl")
	e:SetParent("Valvebiped.bip01_pelvis")
	e:AddEffects(EF_BONEMERGE)

If anyone coud help poin me in the right direction or tell me the rules for using this, I would be grateful.

What you need is a bone ( or bones ) with same name in both model.
Then you parent one entity to another and apply bonemerge flag.

Sorry but I am still confused. I might be over thinking this. I am guessing you mean set a variable/entity to equal the player model the player has, and then parent it to that variable/entity? As for the bones, the names should be the same. I copied the weight map and skeleton from the player model to my prop.

You don’t really need all the bones, you need only those you want to bonemerge.
About parenting, you want to create your prop, parent it to whatever you want it bonemerge it and set the flag on your prop.

You’re doing it correctly, just change to: SetParent( PLAYER_ENTITY_HERE )
You don’t need to call a specific bone when using bone merge, it will merge the same named bones in your model. You said you copied the player model skeleton, so it should work fine.

Oops, to late. What he said.

oh wow thanks. I guess I was over thinking this.