x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: Not Selected
Tags:
more ▼

asked Feb 01 '15 at 06:56 PM in Blueprint Scripting

avatar image

LitStudio
371 55 49 64

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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)

more ▼

answered Feb 25 '17 at 04:51 PM

avatar image

eXi
6.8k 333 185 468

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered Feb 01 '15 at 09:50 PM

avatar image

eXi
6.8k 333 185 468

avatar image LitStudio Feb 01 '15 at 11:24 PM

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?

avatar image eXi Feb 02 '15 at 05:39 AM

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.

avatar image eXi Feb 02 '15 at 09:54 AM

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.

asdass

wewe

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

asdww

weww

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

wewes

avatar image eXi Feb 02 '15 at 11:02 PM

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.

asdasd

Then you could do something like this:

asdawesd

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

avatar image Matme1979 Feb 25 '17 at 12:22 PM

Just found this. Brilliant help, eXi, thanks.

avatar image eXi Feb 25 '17 at 04:51 PM

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)

avatar image LitStudio Feb 04 '15 at 04:42 PM

Good :D I will try this later!

avatar image LitStudio Feb 09 '15 at 12:38 AM

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...

avatar image eXi Feb 09 '15 at 11:07 AM

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.

avatar image LitStudio Feb 09 '15 at 01:24 PM

Thanks!!!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question