CharacterClass.client_onMelee

Called when the Character is hit by a melee hit.

Kind: Callback

Environments: Game

Game

Callback side: Client

CharacterClass:client_onMelee(
    position,
    attacker,
    damage,
    power,
    direction,
    normal
)

Open the full Game reference

Parameters:

Name Type Description
self table The class instance.
position Vec3 The position in world space where the Character was hit.
attacker Player/nil The attacker. Can be a Player or nil if unknown. Attacks made by a Unit will be nil on the client.
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.