CharacterClass.client_onProjectile

Called when the Character is hit by a projectile.

Kind: Callback

Environments: Game

Game

Callback side: Client

CharacterClass:client_onProjectile(
    position,
    airTime,
    velocity,
    projectileName,
    shooter,
    damage,
    customData,
    normal,
    uuid,
    mass
)

Open the full Game reference

Note: If the shooter is destroyed before the hit lands, the shooter value will be nil.

Parameters:

Name Type Description
self table The class instance.
position Vec3 The position in world space where the projectile hit the Character.
airTime number The time, in seconds, that the projectile spent flying before the hit.
velocity Vec3 The velocity of the projectile at impact.
projectileName string The name of the projectile. (Legacy, use uuid instead)
shooter Player/Shape/Harvestable/nil The shooter, can be a Player, Shape, Harvestable or nil if unknown. Projectiles shot by a Unit will be nil on the client.
damage number The damage value of the projectile.
customData any A Lua object that can be defined at shoot time using sm.projectile.customProjectileAttack or an other custom version.
normal Vec3 The normal at the point of impact.
uuid Uuid The uuid of the projectile.
mass number The mass of the projectile.