AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity following attachment rather than another entity (https://forums.alliedmods.net/showthread.php?t=214927)

Backstabnoob 05-01-2013 12:08

Entity following attachment rather than another entity
 
To make a hat stick to the player's head I'm using MOVETYPE_FOLLOW, which kind of works now, but not for what I'm going to do.

I've added a set of additional animations to the player's model, which don't change the player's origin (such as dancing; the model moves a few inches forward but the actual hitbox remains on the same spot).

The question is - is there a way to attach the hat entity directly to the bone, which is:
Quote:

Originally Posted by http://wiki.amxmodx.org/FakeMeta_Functions_Detailed_Descriptions#EngF unc_GetBonePosition
Bone 8 Name: "Bip01 Head"

Now I could probably get the attachment's origin with EngFunc_GetBonePosition and keep changing the hat's origin to it in PreThink, but as we all know that's pretty laggy unless on LAN server and doesn't look very great.

Creating a beam allows to select an attachment it will stick to in the message, but I haven't found a way to do this with an entity.

https://forums.alliedmods.net/archiv...p/t-59595.html


Thanks in advance.

Sam Tsuki 05-01-2013 12:57

Re: Entity following attachment rather than another entity
 
I tried EngFunc_GetBonePosition but it doesn't work with animations
it just gets the bone position for frame 0
Does it work for u?

Backstabnoob 05-01-2013 13:28

Re: Entity following attachment rather than another entity
 
I haven't tried it yet, but if it doesn't work then there's probably no way to do it


All times are GMT -4. The time now is 23:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.