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"

Can't apply damage to players over a Network


I have a problem, I am trying to create a simple SMG type of gun. Using a Line Trace by Channel, I managed to hit a player and cast it to a MyCharacter. If the cast works, then I spawn aExplosion emitter, just to see visually if I am hitting the player. Then i use a Apply Damage Node.

The blueprint for the first paragraph. alt text

Then, I do the following to apply the damage to a player. It checks if the current value is 0, if it is not, then it can apply the damage and change the Health variable I have created. Blueprint. alt text

When I test this, it behaves wrong. For example, if I use the second player. And I hit the first dude. Nothing happens, the explosion happens, but the damage ain't applied. alt text

But if I use the first dude, then it does the damage to itself! alt text

Please, let me know how I can do this correctly! Thanks!

Product Version: Not Selected
more ▼

asked Dec 03 '14 at 04:51 PM in Blueprint Scripting

avatar image

620 58 64 306

avatar image Motanum Dec 03 '14 at 06:14 PM

Update, Changing the Damaged Actor will now apply from player 1 to player 2. But not from player 2 to player 1. alt text

alt text

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

1 answer: sort voted first

I got it working. Note! This might not be cheat proof.

The problem is that ApplyDamage works/runs only on the server. So I made a function the following changes. The client tells the server he hit a player! alt text

The custom function replicates to Run on a server. alt text

Then, the apply damage manages the hitting stuff alt text

more ▼

answered Dec 05 '14 at 05:17 PM

avatar image

620 58 64 306

avatar image Bproof May 05 '15 at 11:15 AM

Hey, thank you so much for posting this! I was searching for an answer for days and I finally found it, thanks to you. Cheers :)

(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