Spawning prefabs

Modified on Sun, 29 Nov 2020 at 07:25 PM

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



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:




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 article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article