Skip to content

setFoliageVertices

Client-side

Available in Neon, not standard MTA

Replaces the three corners of a foliage patch and rebuilds the native triangle.

Syntax

bool setFoliageVertices(foliage theFoliage, Vector3 v1, Vector3 v2, Vector3 v3)

Arguments

theFoliagefoliage

Foliage element.

v1Vector3

First corner.

v2Vector3

Second corner.

v3Vector3

Third corner.

Returns

true when the new triangle was accepted and rebuilt; false for a degenerate or non-finite triangle.

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.

Important behavior
  • The rebuild is atomic: a rejected triangle leaves the previous vertices, surface and density untouched.
  • setElementPosition also works and translates the whole triangle.

OOP aliases

  • foliage:setVertices(v1, v2, v3)

Where this comes from

RELATED NEON APIS

Continue exploring

Read the system guide →