Spawning Prefabs

intermediate feature

Voxel Play 3 · Features

Voxel Play includes a simple prefab spawner implemented as a Detail Generator:

Voxel play spawning prefabs 0

This script allows you to specify a list of prefabs, suitable biomes and a probability (a prefab will be randomly picked in case a prefab would be spawned in a chunk).

You can add any number of spawners to the Detail Generator list of the World Definition:

Voxel play spawning prefabs 1

The "Optimize Material" will replace the prefab material with the Voxel Play/Models/Texture/Opaque shader so it gets proper lighting in all conditions.

The "Add Mesh Collider" will ensure the model has a collider in case the prefab doesn't have one.

Remember to add ths prefab spawner asset to the list of Detail Generators of the World Definition asset.

Was this page helpful?