Voxel Behavior & Gameplay
intermediate featureVoxel Play 4 adds several voxel-level gameplay and authoring options on top of the Voxel Play 3 systems: per-voxel item drops, a configurable pickup radius and finer control over cross (vegetation) voxels.
Item Drops
A VoxelDefinition can spawn a specific item when the voxel is destroyed, instead of a generic recoverable voxel. The item's own prefab is used.
| Field | Purpose |
|---|---|
dropItem | The ItemDefinition to spawn on destruction. Leave empty for the default recoverable-voxel behavior. |
dropItemScale | Scale of the dropped item (default 0.25). |
dropItemLifeTime | Seconds before the drop despawns (default 10). |
Pickup Radius
Controls how close the player must be to collect a dropped item.
- Default Pickup Radius - global setting on the Voxel Play Environment (
defaultPickupRadius, default 2.55). - Per-item override -
ItemDefinition.pickupRadius. A value of0falls back to the global default.
Cross (Vegetation) Voxels
Cross voxels render as two crossed quads (grass, flowers, bushes, cobwebs). VP4 adds per-definition shaping:
| Field | Purpose |
|---|---|
Width Variation (vegetationMinWidth / vegetationMaxWidth) | MinMax range for a deterministic per-instance horizontal scale, so plants vary in width. Default 1-1 (no variation). |
Highlight Scale (vegetationHighlightScale) | Vector2 to fine-tune the selection highlight box when the texture does not fill the whole cross quad. |
Destroy With Voxel Below (destroyWithVoxelBelow) | CutoutCross voxels only. Default true: the cross is removed when the voxel under it is destroyed. Disable to keep cobwebs, barbed wire or decals in place. |
See Also
- Interactive Objects (VP3 docs)
- Smooth Terrain - vegetation snapping on smooth surfaces
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.