This tutorial demonstrates how to create a destructible city environment mod, similar to the NYC sample scene.
Path in Mod Toolkit: Assets/Samples/com.cydream.nyc
Create your city buildings and environment in MagicaVoxel.
MagicaVoxel has a size limit (usually 256x256x256 per object). City buildings can often exceed this size.
_x2 to the object name as a reminder to scale it back up by 2x in the Unity Editor later.For destructible buildings that need to stay rooted to the ground until their base is destroyed, use the C_ prefix.
C_ (Strong Connected): Objects with this prefix are imported as destructible items but include an UnyieldingArea component. This component keeps the object "kinematic" (immovable) as long as the unyielding area overlaps with a static object (like the ground).
C_BuildingA, C_SkyscraperRefer to the Scene Naming Guide for more details.
.vox file using the Asset Processor.(2, 2, 2).To create a large, solid ground for the city, use the HeightmapVoxels system. This is more efficient than building a massive floor in MagicaVoxel.
HeightmapVoxels component.
For your C_ buildings to stand upright:
UnyieldingArea component (automatically added by the C_ prefix).Register your scene in the manifest.
manifest asset.Before testing or publishing the scene, select the Voxel Scene component and click Preview Voxel Objects. The preview displays three budget metrics:
For the NYC sample, the preview reports 658,806 / 800,000 tris, 7,580,138 / 8,000,000 voxels, and 95 / 500 voxel object proxies, all within budget.
If any value is over budget, simplify the voxel model, split or merge objects where appropriate, and preview again before exporting.
Build and test your city scene.