Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function GetHitboxCenter( ent, hitbox )
- local bpos, bang = ent:GetBonePosition( ent:GetHitBoxBone( hitbox, 0 ) );
- local mins, maxs = ent:GetHitBoxBounds( hitbox, 0 );
- local matrix = {
- [0] = Vector( 0, 0, 0 ),
- [1] = Vector( 0, 0, 0 ),
- [2] = Vector( 0, 0, 0 ),
- };
- AngleMatrix( bang, matrix );
- local rmins, rmaxs = Vector( 0, 0, 0 ), Vector( 0, 0, 0 );
- RotateVector( mins, matrix, rmins );
- RotateVector( maxs, matrix, rmaxs );
- return bpos + ( ( rmins + rmaxs ) / 2 );
- end
Advertisement
Add Comment
Please, Sign In to add comment