Terrain Samples
Scenes showcasing runtime terrain features.
These scenes demonstrate terrain tree interaction workflows driven by Flora instance APIs.
Tree Effect
This sample animates terrain tree instances inside a spherical influence volume.

Scene Path
Samples~/Examples/Terrain/Scenes/TreeEffectSample.unity
What This Demonstrates
Tree instance query by sphere
Local-to-world retrieval and update
Per-instance runtime animation without converting trees to scene objects
APIs Exercised
FindInstancesIntersectingSphereMatching(...)GetInstanceLocalToWorlds(...)UpdateInstanceLocalToWorlds(...)FloraInstanceFilter.ByTrees()
Run and Verify
Open
TreeEffectSampleand press Play.Move/observe effect sphere region.
Confirm nearby trees animate and recover when leaving the region.
Expected result: only trees in-range are displaced/animated.
Common Failure Checks
No response: verify
EnableTerrainFoliageand terrain auto-registration.Trees remain offset after stop: check cleanup/restore path in sample script.
Tree Wrecking Ball
This sample demonstrates physics interaction that disables terrain-tree instances and spawns replacement rigidbody objects.

Scene Path
Samples~/Examples/Terrain/Scenes/WreckingBallSample.unity
What This Demonstrates
Collision-region tree query
Instance enable/disable control
Runtime replacement with
GameObject+FloraInstanceRenderer
APIs Exercised
FindInstancesIntersectingSphereMatching(...)SetInstancesEnabled(...)GetInstanceWorldTransform(...)GetInstancePrefab(...)GetAuthoringTerrainOf(...)
Run and Verify
Open
WreckingBallSampleand press Play.Let wrecking ball collide with trees.
Confirm impacted trees are hidden as Flora instances and replaced with rigidbody objects.
Expected result: collision zone trees convert to physics-driven replacements; Flora instances are disabled.
Common Failure Checks
Trees never disable: verify query region radius/position is valid.
Replacements missing Flora rendering: ensure
FloraInstanceRendereris added and prefab assigned.
Last updated
