How make a Headshot?

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…?

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

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?

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.

1 Like

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/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/fmMjH/2fe397dce3.png

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

http://puu.sh/fmOrB/26e1840b5a.jpg

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

Then you could do something like this:

http://puu.sh/foqaj/b96e37c097.png

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

Good :smiley: I will try this later!

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…

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.

Thanks!!!

Just found this. Brilliant help, eXi, thanks.

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)

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)

1 Like

But will it work with projectile bullet