Doubt Regarding How HasAuthority() Function plays a role in damage dealing

After finishing the coop mp course, Im trying to build my own game, and i have a doubt regarding using the function ApplyRadialDamageWithFalloff and its implications with HasAuthority.

Say, there are 3 players (on multiplayer, 1 server 2 clients) the bomb the player throws Are supposed to deal damage to the player in explosion range. So now im confused if the ExplodeBomb() function which calls ApplyRadialDamageWithFalloff to deal damage, needs authority to deal damage or not? Since i udnerstand ApplyRadialDamageWithFalloff is a “server” only function. Im slighlty confused.

I Can Attach any relevant Code if required.

Damage should be applied on the server. If you don’t use the authority check, you could be applying the damage both on the client and the server. This also enables an avenue for cheating in that someone could disable damage being applied in the client or even increase the amount of damage taken bt others.

Does this make sense?

Yes that makes sense, Thanks for the explanation, So then the server would replicate the damage to the clients after dealing damages right…

Yes, that would be the intention.

Got it! Much appreciated.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms