# How make a Headshot?

**URL:** <https://forums.unrealengine.com/t/how-make-a-headshot/305676>\
**Category:** Community & Industry Discussion\
**Tags:** Trace, how-to, unreal-engine, hitbox, question\
**Created:** [February 1, 2015, 6:56pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676 "2015-02-01T18:56:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_0599cf61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0599cf61](https://forums.unrealengine.com/u/anonymous_user_0599cf61)\
**Post date:** [February 1, 2015, 6:56pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/1 "2015-02-01T18:56:27Z")

</div>

Can anyone explain in a screenshot how create a headshot? And if is possible…how can I cause less damage if I hit the body, arms or legs of my bot…?

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 1, 2015, 9:50pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/2 "2015-02-01T21:50:24Z")

</div>

Add a collision capsule to each one. Create an Overlap Event for every single one and let them change the damage before applying it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0599cf61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0599cf61](https://forums.unrealengine.com/u/anonymous_user_0599cf61)\
**Post date:** [February 1, 2015, 11:24pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/3 "2015-02-01T23:24:29Z")

</div>

Overlap event works with raycast? Single line trace for objects and etc? Because I see the overlap Event if I use projectiles…and i want to know what is better for perfomace…mesh projectiles or Raycast?

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 2, 2015, 5:39am UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/4 "2015-02-02T05:39:30Z")

</div>

Projectiles or raycast depends on your weapon. A MG would use raycast but a rocket launcher uses a projectile.

You should be able to make linetrace per channel and add different new collision channels in your project settings. these can be added to the collision boxes for example.

Sorry for the vaguea answer. It was late yesterday. When im home later the day and you still have problems, then i will try to create you an example.

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 2, 2015, 9:54am UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/5 "2015-02-02T09:54:28Z")

</div>

I just had a look at it. You might just check the Line Trace for specific Bone Names. The standard 3rd Person Mesh from Epic has a bone named “head”. if you break the hitreselt and take the Bone Name, you can perform a “Switch on Name” for all the bone names you want to seperate and a “Default” pin for the rest of them.

Although this won’t be so accurate.

If you create a collision capsule and place it as a child of the mesh, you can parent it to the bone, so it moves with it. Then you only need to scale the capsule correctly.

[http://puu.sh/fmM2t/ee2f64a000.jpg](http://puu.sh/fmM2t/ee2f64a000.jpg)

[http://puu.sh/fmM7t/87fd869897.jpg](http://puu.sh/fmM7t/87fd869897.jpg)

You can create a new Collision Type in the Project settings to only trace the body parts:

[http://puu.sh/fmMdV/b43b5c7155.png](http://puu.sh/fmMdV/b43b5c7155.png)

[http://puu.sh/fmMjH/2fe397dce3.png](http://puu.sh/fmMjH/2fe397dce3.png)

Now you could check the HitResult for the spicific capsuls you hit.

[http://puu.sh/fmOrB/26e1840b5a.jpg](http://puu.sh/fmOrB/26e1840b5a.jpg)

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 2, 2015, 11:02pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/6 "2015-02-02T23:02:55Z")

</div>

Ok, figured out an addition to this, since the Display Name is not valid to be used to compare it.

You can add Tags to your Components. I would say you group up the capsules, that share the same amount of damage, with the same tag.

[http://puu.sh/foq3X/d6e26d3bf9.png](http://puu.sh/foq3X/d6e26d3bf9.png)

Then you could do something like this:

[http://puu.sh/foqaj/b96e37c097.png](http://puu.sh/foqaj/b96e37c097.png)

Doesn’t seem to be an easier way with only Blueprints.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0599cf61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0599cf61](https://forums.unrealengine.com/u/anonymous_user_0599cf61)\
**Post date:** [February 4, 2015, 4:42pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/7 "2015-02-04T16:42:04Z")

</div>

Good 😃 I will try this later!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0599cf61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0599cf61](https://forums.unrealengine.com/u/anonymous_user_0599cf61)\
**Post date:** [February 9, 2015, 12:38am UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/8 "2015-02-09T00:38:35Z")

</div>

One more question…Can I subtract a life variable from a blueprint without cast it in a Trace? If not okay…i only thinking a lot of manners to simplify work…

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 9, 2015, 11:07am UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/9 "2015-02-09T11:07:11Z")

</div>

You mean you have a health variable on the enemy and you don’t want to cast everytime to get access to it? Try using the “Apply damage” node with the actor you want to hurt. This will trigger “Event any damage” on the actor. That’s also a node. You can pass a damage variable with it an make the minus health calculation inside the actor you want to hurt.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0599cf61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0599cf61](https://forums.unrealengine.com/u/anonymous_user_0599cf61)\
**Post date:** [February 9, 2015, 1:24pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/10 "2015-02-09T13:24:27Z")

</div>

Thanks!!!

---

<div class="post-metadata">

**Author:** ![Matme1979](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matme1979](https://forums.unrealengine.com/u/Matme1979)\
**Post date:** [February 25, 2017, 12:22pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/11 "2017-02-25T12:22:34Z")

</div>

Just found this. Brilliant help, eXi, thanks.

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 25, 2017, 4:51pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/12 "2017-02-25T16:51:00Z")

</div>

There might actually be a better way. The PhysicsAsset that comes with a SkeletalMesh is meant to have collision already.  
A shot should only collide with this Mesh, so it uses the individual collision capsulse that the PhysicAsset already gives you.  
(In other words, the Capsule around the player needs to ignore the weapon trace, while the SkeletalMesh needs to block it!).

The HitResult of the Trace should then give you the BoneName that the hit Capsule belongs to.

So you actually don’t need to create the Collision in the Blueprint anymore, but just use the PhysicsAsset.  
(I wasn’t that skilled 2 years ago, sorry)

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [February 25, 2017, 4:51pm UTC](https://forums.unrealengine.com/t/how-make-a-headshot/305676/13 "2017-02-25T16:51:16Z")

</div>

There might actually be a better way. The PhysicsAsset that comes with a SkeletalMesh is meant to have collision already. A shot should only collide with this Mesh, so it uses the individual collision capsulse that the PhysicAsset already gives you. (In other words, the Capsule around the player needs to ignore the weapon trace, while the SkeletalMesh needs to block it!).

The HitResult of the Trace should then give you the BoneName that the hit Capsule belongs to.

So you actually don’t need to create the Collision in the Blueprint anymore, but just use the PhysicsAsset. (I wasn’t that skilled 2 years ago, sorry)
