# Can't apply damage to players over a Network

**URL:** <https://forums.unrealengine.com/t/cant-apply-damage-to-players-over-a-network/300480>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, apply-damage, unreal-engine, Blueprint, question\
**Created:** [December 3, 2014, 4:51pm UTC](https://forums.unrealengine.com/t/cant-apply-damage-to-players-over-a-network/300480 "2014-12-03T16:51:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Motanum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Motanum](https://forums.unrealengine.com/u/Motanum)\
**Post date:** [December 3, 2014, 4:51pm UTC](https://forums.unrealengine.com/t/cant-apply-damage-to-players-over-a-network/300480/1 "2014-12-03T16:51:05Z")

</div>

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](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](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](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](http://puu.sh/dfvXK/19a0df7109.jpg)

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

---

<div class="post-metadata">

**Author:** ![Motanum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Motanum](https://forums.unrealengine.com/u/Motanum)\
**Post date:** [December 3, 2014, 6:14pm UTC](https://forums.unrealengine.com/t/cant-apply-damage-to-players-over-a-network/300480/2 "2014-12-03T18:14:15Z")

</div>

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/dfBms/9b1e4cc6cf.png)

[http://puu.sh/dfBoL/fed476e5f4.jpg](http://puu.sh/dfBoL/fed476e5f4.jpg)

---

<div class="post-metadata">

**Author:** ![Motanum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Motanum](https://forums.unrealengine.com/u/Motanum)\
**Post date:** [December 5, 2014, 5:17pm UTC](https://forums.unrealengine.com/t/cant-apply-damage-to-players-over-a-network/300480/3 "2014-12-05T17:17:00Z")

</div>

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](http://puu.sh/diaEj/7d9a90529d.jpg)

The custom function replicates to Run on a server.

[http://puu.sh/diaI7/6824f40a7e.png](http://puu.sh/diaI7/6824f40a7e.png)

Then, the apply damage manages the hitting stuff

[http://puu.sh/diaKj/6a5f5bf274.jpg](http://puu.sh/diaKj/6a5f5bf274.jpg)

---

<div class="post-metadata">

**Author:** ![TactileVisions](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tactilevisions/32/1194626_2.png) [@TactileVisions](https://forums.unrealengine.com/u/TactileVisions)\
**Post date:** [May 5, 2015, 11:15am UTC](https://forums.unrealengine.com/t/cant-apply-damage-to-players-over-a-network/300480/4 "2015-05-05T11:15:55Z")

</div>

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 🙂
