ShapeClass.server_onMelee
Called when the Shape is hit by a melee attack.
Kind: Callback
Environments: Game
Game
Callback side: Server
ShapeClass:server_onMelee(
position,
attacker,
damage,
power,
direction,
normal
)
Note: If the attacker is destroyed before the hit lands, the attacker value will be nil.
Parameters:
| Name | Type | Description |
|---|---|---|
self |
table | The class instance. |
position |
Vec3 | The position in world space where the Shape was hit. |
attacker |
Player/Unit/nil | The attacker. Can be a Player, Unit or nil if unknown. |
damage |
integer | The damage value of the melee hit. |
power |
number | The physical impact impact of the hit. |
direction |
Vec3 | The direction that the melee attack was made. |
normal |
Vec3 | The normal at the point of impact. |