Download

Aplying damage on Multiplayer Melee Game

Hi there guys, got a few questions… We are currently developing a melee combat system, and so far so good, it’s replicating and what not. Now we are on the part where we need to apply damage/Block with shield.

So super quick, first i need to detect a Hit and try to apply damage. I have 2 alternatives that i can think of:

  1. Put a Collider on the weapon and detect OnColliderBeginOverlap , check if the target is an enemy and try to apply damage to him

The problem that i’m reading is that if one wants to make Server Authoritative Damage, the server would need to run the animation and that’s pretty much expensive.

  1. Make a Raycast, Spherecast etc on the area i wish to damage, this is triggered by the client on an AnimNotify Event on the animation, but the Server does the Checking and Apply Damage of everyone.

This sounds good, but i would have to “hard code” the triggers for each kind of attack so i’m not sure it this is the way it’s supposed to be done on a Network Game.

The other part of the question is about Blocking Damage via shield. For this i read that the best way to do this is use ApplyPointDamage and check the impact point and normal of the attack to see if the shield could have blocked it (i.e. back attacks are non blockable).

For this implementation i need a Raycast hit result, but the Overlaping method of detecting the attack does not give one back. So again, point for the Raycast Method.

I’m really leaning forward the Raycast method but i’m not entirely sure. I need some feedback from guys who have done this because this is a huge compromise on future developments.

Thanks guys!

bump!, dead forum