ShapeClass.server_onProjectile

Called when the Shape is hit by a projectile.

Kind: Callback

Environments: Game

Game

Callback side: Server

ShapeClass:server_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 Shape.
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/Unit/Shape/Harvestable/nil The shooter. Can be a Player, Unit, Shape, Harvestable or nil if unknown.
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.