Jump to content

head shot


Phattalapol
 Share

Recommended Posts

It would be too much code to paste here, but the principle is that you check what was the name of the mesh which was hit with EntityPick().

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I've thought about this for my own stuff and this is what I'd do:-

 

Got message i've been hit by bullet

Message contains location of bullet hit

 

For each bone in my model

work out with math fiddle closest bone in model to hit location

next

 

if bone is head then

HEAD SHOT!

endif

 

 

Hopefully in a month or two I'll have a working example in C++.

 

However it seems to me you prehaps deciding what colour to paint your hand built car before you've even tightened the first nut or done your first weld.... I'd try to get the basics done first.

Link to comment
Share on other sites

For a headshot in particular you might just want to look at LOCAL Y position of the hit and decide it's a headshot if it's over a certain value (which might change depending on if they're in a crouched state or an upright state, etc). This would be faster than iterating over the bones and doing distance calculations. But if you want per body part detection to blow off arms and such then Chris's implementation is a lot more robust and could handle that.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...