How to demolish Nested Cluster by collision.

Nested cluster allows to simulate a group of objects under one root as a single object and demolish it to single objects and smaller Nested Clusters. While Connected Cluster demolition depends on collision or impact point and can be different every time, Nested Cluster allows to get the same demolition pattern every time.

1.	Create Cube, this will be the cube which will be shattered to multiple fragments. These fragments will be used as Shards for Nested Cluster. 

2.	Set its name to "Pillar", position to [0,10,0], rotation to [0,0,90] and scale to [10,0.5,1]

3.	Create another Cube, this will be a ground cube which will be used for collision.

4.	Set its name to "Ground", position to [0,0,0] and scale to [15,1,10]

5.	Add RayFire Shatter component to Pillar and set Type to Voronoi. In Voronoi properties set Amount to 100.

6.	Click on the Fragment button, a new gameobject “Pillar_root” with fragments as it’s children will be created. Destroy original Pillar because we don’t need it anymore.

7.	Add RayFire Rigid component to Pillar_root.

8.	Set Rigid Initialization to At Start.

9.	Set Simulation type to Dynamic so the object will start to fall down immediately after Initialization.

10.	Set Object type to Nested Cluster.

11.	Set Demolition type to Runtime.

Now let's setup Nested cluster hierarchy and predefine how it will be demolished.

12.	Right click on Pillar_root gameobject in the Hierarchy window and Create Empty gameobject as it's child. Name it "Nest_1".

13.	In the same way create a second empty gameobject and name it "Nest_2".

14.	Select approximately 40% of pillar fragments in the viewport starting from the top and set them as children for the Nest_1 object.

15.	Select approximately 40% of pillar fragments in the viewport starting from the bottom and set them as children for the Nest_2 object. 

Now you Pillar_root should have two nested clusters Nest_1 and Nest_2 and some amount of shards as it's children.

16.	Start Play Mode. 

Pillar will fall down and be demolished to two predefined child nested Clusters and shards which were at the middle between them will be simulated separately. In The same way you can create more nested clusters inside child nests and so on. By default nested cluster can be demolished only once. All nested cluster created after demolition won't be demolished anymore. In order to demolish nested cluster even deeper you shoul increase Depth roperty in Limitations properties.

17.	Turn off Play Mode. In Limitations properties set Depth to 2. 

18.	Start Play Mode. 

As you see now Nest_1 and Nest_2 clusters also demolishes during simulation.
But they are too fragile for now and demolished after first collision. Lets make them not so fragile.

19.	Turn off Play Mode. In Cluster Demolition properties set Demolishable to True. 

20.	In Limitations properties set Solidity to 0.4.

21.	Start Play Mode.

	Now Nest_1 and Nest_2 clusters demolishes only when they hit the ground.