Mixed Reality Utility Kit - Having Fun with Destructible Mesh
Updated: Mar 13, 2025
After completing this section, the developer should be able to use the Destructible Mesh feature to gradually remove fragments from the global mesh.
A fun game mechanic is making your space easily destructible, enabling a wide range of interesting use cases such as having your walls crumble to reveal a vast virtual world beyond it.
The DestructibleGlobalMeshSpawner is a component designed to facilitate the spawning and management of destructible global meshes with random segmentation. It offers a variety of customization options:
- Reserved Spaces: Define areas within the mesh that remain non-destructible.
- Segments Density: Adjust the number of segments that the global mesh will be fragmented into to suit performance requirements and aesthetic preferences: the higher the number of segments the higher the impact on performance.
- Material Application: Apply specific materials to the meshes for visual customization.
The spawned game object representing the destructible global mesh contains a
DestructibleMeshComponent component. This component provides an overview of the mesh’s properties and includes debug utilities accessible within the Unity editor.
Notably, each segment of the mesh is instantiated as a separate game object, allowing for independent destruction or manipulation, thereby offering a high degree of flexibility in how the mesh interacts with the environment and gameplay mechanics.