threejs-worldgen
    Preparing search index...

    Function applyDamage

    • Damages everything within radius metres of (x, z): impacts, explosions, falling trees, a burning building (channel: 'burn'). Adds amount at the centre, fading to 0 over the outer falloff share of the radius, clamped to 0…1. Returns the number of instances hit.

      Parameters

      • target: DamageTarget
      • x: number
      • z: number
      • radius: number
      • amount: number
      • channel: StateChannel = 'damage'
      • falloff: number = 0.5

      Returns number