HarvestableClass.client_onProjectile

Called when the Harvestable is hit by a projectile.

Kind: Callback

Environments: Game

Game

Callback side: Client

HarvestableClass: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 projectile hits, 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 Harvestable.
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 integer 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.