Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Terrain Samples

Scenes showcasing runtime terrain features.

These scenes use Flora's runtime APIs to interact with Terrain trees.

Tree Effect

Animates Terrain trees inside a sphere.

Tree Effect sample

Scene Path

Terrain/Scenes/TreeEffectSample.unity

Demonstrates

  • Tree instance query by sphere

  • Local-to-world retrieval and update

  • Per-instance runtime animation without converting trees to scene objects

APIs

  • FindInstancesIntersectingSphereMatching(...)

  • GetInstanceLocalToWorlds(...)

  • UpdateInstanceLocalToWorlds(...)

  • FloraInstanceFilter.ByTrees()

Run

  1. Open TreeEffectSample and press Play.

  2. Confirm trees inside the sphere animate and recover after leaving it.

Tree Wrecking Ball

Disables impacted Terrain trees and spawns Rigidbody replacements.

Tree Wrecking Ball sample

Scene Path

Terrain/Scenes/WreckingBallSample.unity

Demonstrates

  • Collision-region tree query

  • Instance enable/disable control

  • Runtime replacement with GameObject + FloraInstanceRenderer

APIs

  • FindInstancesIntersectingSphereMatching(...)

  • SetInstancesEnabled(...)

  • GetInstanceWorldTransform(...)

  • GetInstanceOwnerTerrain(...)

  • GetInstanceTerrainTreeIndex(...)

Run

  1. Open WreckingBallSample and press Play.

  2. Let wrecking ball collide with trees.

  3. Confirm impacted Flora instances are hidden and replaced with Rigidbody objects.

Last updated