Code: Select all
CEntityAttachment *pNewMag = new CEntityAttachment();
if (ICharacterInstance *pChar = pAttachRequestor->GetEntity()->GetCharacter(Character_slot))
if (IAttachmentManager *pMan = pChar->GetIAttachmentManager())
if (IAttachment *pAttachment = pMan->GetInterfaceByName("mag_att"))
I attach it as I always do, the same attachment like I use for attaching weapon to player, but this doesn't seem to have any delay at all. I don't want to set attachment on player and add offset, cause every weapon has different position of ammo clip and I would have to set up custom offset for each weapon, it's ridiculous.
Also I want to say that I made sure no simulation is applied. I've noticed something weird though. If I attach the same model for ammo clip (cgf) in character tool, it moves properly, but if do it on the run (in c++) it does this delay
Edit: issue solved.
Solution I used is CGFAttachment. So I grabbed static object of this entity and attached it instead. It is more efficient and causes absolutely no problems