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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I apply damage when a player is shot?

Hi, I'm making a multiplayer game, but how can I apply a damage when the player was shot?

Product Version: Not Selected
Tags:
more ▼

asked Sep 11 '14 at 03:04 PM in Blueprint Scripting

avatar image

Scienziatogm
369 44 40 51

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

2 answers: sort voted first

The problem was that the Apply damage function works only on server, and the input functions haven't got Authority.

more ▼

answered Sep 21 '14 at 06:48 PM

avatar image

Scienziatogm
369 44 40 51

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

Hey Scienziatogm-

You could use the Apply Damage node with the damaged actor being the target getting hit and the damage causer as the weapon projectile.

more ▼

answered Sep 11 '14 at 06:02 PM

avatar image Scienziatogm Sep 11 '14 at 06:43 PM

How do I apply this to a hitscan weapon instead of a projectile weapon?

avatar image Adam Davis STAFF Sep 11 '14 at 06:51 PM

Hi Scienziatogm,

The apply damage node can get it's damaged actor from the break hit result under a trace for hitscans. Then the damage causer is the weapon or the player.

avatar image Scienziatogm Sep 11 '14 at 07:13 PM

I did this:

Event InputActionFire: alt text

Event Any Damage: alt text

But it doesn't work (when shoot the player, it doesn't decrease the Health).

avatar image Adam Davis STAFF Sep 12 '14 at 07:22 PM

Hi scienziatogm,

Did you use a cast to node to the hit actor? If so you should be able to directly affect the health variable.

avatar image Scienziatogm Sep 12 '14 at 10:08 PM

What do you mean? If I link the Hit Actor to the Cast node, I can't set any variable.

avatar image Scienziatogm Sep 21 '14 at 04:45 PM

I suppose that the Apply damage function is bugged, because if I do this, it doesn't decrease health.

alt text

(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