Can't apply damage to players over a Network

Hello

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.

http://puu.sh/dfvq3/1eb2974a53.jpg

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.

http://puu.sh/dfvvG/4712ff6061.jpg

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.

http://puu.sh/dfvUe/e487594ed4.jpg

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

http://puu.sh/dfvXK/19a0df7109.jpg

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

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

http://puu.sh/dfBms/9b1e4cc6cf.png

http://puu.sh/dfBoL/fed476e5f4.jpg

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!

http://puu.sh/diaEj/7d9a90529d.jpg

The custom function replicates to Run on a server.

http://puu.sh/diaI7/6824f40a7e.png

Then, the apply damage manages the hitting stuff

http://puu.sh/diaKj/6a5f5bf274.jpg

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 :slight_smile: