# Apply Damage and Event AnyDamage have different values

**URL:** <https://forums.unrealengine.com/t/apply-damage-and-event-anydamage-have-different-values/1263339>\
**Category:** Blueprint\
**Tags:** apply-damage, unreal-engine\
**Created:** [August 16, 2023, 10:22pm UTC](https://forums.unrealengine.com/t/apply-damage-and-event-anydamage-have-different-values/1263339 "2023-08-16T22:22:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vachy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vachy/32/968852_2.png) [@Vachy](https://forums.unrealengine.com/u/Vachy)\
**Post date:** [August 16, 2023, 10:22pm UTC](https://forums.unrealengine.com/t/apply-damage-and-event-anydamage-have-different-values/1263339/1 "2023-08-16T22:22:06Z")

</div>

Hello,  
I have a little problem with “Apply Damage” accuracy.  
It generates a random number and passes it through “Apply Damage” but the value at “Event AnyDamage” is different. Any idea why?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/b/2dbb1bd01905a52d4dcb063eaddcc24f56d5720c.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/e/01e209c711c4f67b504188cf0980aca5e89ee20b.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/0/b7022c227d60df8816bb1f9386a7f565b878d514.jpeg)

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [August 17, 2023, 1:06am UTC](https://forums.unrealengine.com/t/apply-damage-and-event-anydamage-have-different-values/1263339/2 "2023-08-17T01:06:52Z")

</div>

Is apply damage strictly being called by the server? If not you could be getting a dbl execution.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 17, 2023, 7:46am UTC](https://forums.unrealengine.com/t/apply-damage-and-event-anydamage-have-different-values/1263339/3 "2023-08-17T07:46:42Z")

</div>

> [@Vachy](#):
>
> Any idea why?

You’re generating 2 _different_ `randoms` here:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/b/dbb1f5b81d1cbc434d752d10e331f9d08283919b.png)

You push one into the interface and the other into the actor / widget / text render (whatever shows 5 here) to the right where we cannot see it.

* * *

- either generate the random value once and then use it many times, try:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/7/5773a05f83c3eb6f4c5a5c9c5ef2336c49d98860.png)

- or move the part of the script that shows it (the widget / actor thing) into the Pepe actor who receives the interface message
- the debugger might be showing the wrong info - it’s not reliable when values are evaluated off pure functions =\> stale data
- I might be wrong and it is, indeed, a multiplayer thing

_edit:_

- any behind the scenes `Damage Type Class` processing, since you are using it?

---

<div class="post-metadata">

**Author:** ![Vachy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vachy/32/968852_2.png) [@Vachy](https://forums.unrealengine.com/u/Vachy)\
**Post date:** [August 17, 2023, 11:37am UTC](https://forums.unrealengine.com/t/apply-damage-and-event-anydamage-have-different-values/1263339/4 "2023-08-17T11:37:23Z")

</div>

I am just dumb… I didn’t realize that the debug shows the last number generated which is the one that goes into the widget

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/f/51fbe3d306c549ea72fc22e3ec1c52a727729e51.png)

So I did it like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/3/ca32fc97957e03c11a7205406b320f0ef321f826.png)
