Nial
07-18-2007, 06:57 AM
I'm trying to attach an entity to a player model. Here's some quick test code I came up with:
pFiremanAttachment = ( NbNFiremanAttachment * )CreateEntityByName( "nbn_fireman_attachment" );
Vector aVec;
QAngle aAngle;
int aId = LookupAttachment( "anim_attachment_LH" );
GetAttachment( aId, aVec, aAngle );
pFiremanAttachment->SetAbsOrigin( aVec );
pFiremanAttachment->SetAbsAngles( aAngle );
pFiremanAttachment->SetParent( this, aId );
pFiremanAttachment->Spawn();
This works but the attachment seems to 'jitter'. I wanted to check that I'm going about this the right way.
pFiremanAttachment = ( NbNFiremanAttachment * )CreateEntityByName( "nbn_fireman_attachment" );
Vector aVec;
QAngle aAngle;
int aId = LookupAttachment( "anim_attachment_LH" );
GetAttachment( aId, aVec, aAngle );
pFiremanAttachment->SetAbsOrigin( aVec );
pFiremanAttachment->SetAbsAngles( aAngle );
pFiremanAttachment->SetParent( this, aId );
pFiremanAttachment->Spawn();
This works but the attachment seems to 'jitter'. I wanted to check that I'm going about this the right way.