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 could I make a line trace weapon do more damage with headshots?

Hey guys! I'm making an fps game and I was wondering if there would be a way to make a head shot do more damage to another actor, in the case, an AI character. I am using a very simple line trace weapon and I have the damage system set up, but how can allow my blueprints to know when I have hit the character's head? Thanks so much!

Product Version: UE 4.10
more ▼

asked Apr 08 '16 at 12:43 AM in Blueprint Scripting

avatar image

170 35 29 54

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

2 answers: sort voted first

It's pretty simple. You can create a branch using the bone name from your line trace hit result. If bone name = "head" then X else Y.

alt text

headshotlogic.gif (67.5 kB)
more ▼

answered Apr 08 '16 at 03:42 PM

avatar image

163 14 19 32

avatar image Anaklosmos Apr 09 '16 at 04:17 AM

Okay so I have tried doing this straight from my break hit result. Ive tried these two methods:

  • Getting the hit bone and seeing if it equals head

  • Creating a sphere over the head and seeing if I hit that actor

Neither of these two methods are returning as a "Headshot". I have attached a screenshot of my methods below.

alt text

untitled-2.png (344.7 kB)
avatar image Anaklosmos Apr 09 '16 at 04:48 AM

Nevermind! It works perfectly! I had to scale the skeletal mesh up so his head reached outside of his capsule component. Because of the capsule component, the line trace was not actually hitting the head, but scaling him up made his head accessible! Thanks a lot!

avatar image SVR33 Apr 09 '16 at 11:07 AM

A cleaner solution would be to change the collision visibility on the capsule so it doesnt block line traces and the character's head isn't poking out - might save you some headaches later.

Glad you got it working.

avatar image Anaklosmos Apr 10 '16 at 01:37 AM

I had to do this because getting rid of the collision would ruin the ragdoll system that I have set up, but yes! Thanks again for the help! I really appreciate it! XD

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

answered Apr 08 '16 at 12:47 AM

avatar image

1.8k 65 27 89

(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