I'm currently attempting to have an entity attach itself to a player.
It will attach to the player, however, the offset for the bone is off,.
Here is a screenshot of what is happening:
[t]http://i.imgur.com/0i6p6Av.jpg[/t]
And here is the code I'm using in the entities Initialize function:
[code]
local ply = self.Parent;
self:SetParent(ply);
local b, a = ply:GetBonePosition(self.Bone);
self:SetPos(b);
self:SetAngles(a);
[/code]
Any help on fixing this issue will be appreciated. Thanks.
That's not bonemerging.
If you want to attach that model to a bone on a player, see Example 2 on this page:
[url]http://wiki.garrysmod.com/page/GM/PostPlayerDraw[/url]
[QUOTE=Robotboy655;51353216]That's not bonemerging.
If you want to attach that model to a bone on a player, see Example 2 on this page:
[url]http://wiki.garrysmod.com/page/GM/PostPlayerDraw[/url][/QUOTE]
I appreciate the response, however, it's not just a model, it's an entity.
Is there not a way to attach an entity to a bone similarly to a model?
Use that code and and transform it to be usable inside your entity's ENT:Draw()
Sorry, you need to Log In to post a reply to this thread.