Skip to content

getFoliageDensity

Client-side

Available in Neon, not standard MTA

Returns the density multiplier of a foliage patch.

Syntax

float|false getFoliageDensity(foliage theFoliage)

Arguments

theFoliagefoliage

Foliage element.

Returns

The density from 0.0 through 10.0, or false when the element is not a foliage element.

Ownership and lifecycle

A foliage element belongs to the resource that created it and joins its element group, so stopping the resource removes its patches without explicit cleanup. Every setter rebuilds the native triangle atomically and rolls back to the previous state when the new combination is rejected.

OOP aliases

  • foliage:getDensity()
  • foliage.density

Where this comes from

RELATED NEON APIS

Continue exploring

Read the system guide →