How to shatter and decompose complex meshes

1.	Create an empty gameobject, and set its name to “Root” and position at [0,0,0]

2.	Create three cubes at position [0, 0, 0], [0, 1.3, 0] and [0, 2.6, 0]

3.	In the Hierarchy window move all cubes under Root and make them it’s children.

4.	Select Root object and add RayFire Combine component.

5.	In Combine component click on Combine button.

	After this Root object will get MeshFilter with complex mesh which consists of cubes meshes. By complex mesh I mean mesh which consists of multiple not connected with each other meshes.

6.	Destroy cubes.

7.	Select Root object and remove RayFire Combine component.

8.	Set its scale to [1,5,1]

	Now we can start to shatter and decompose our complex mesh.

9.	Add RayFire Shatter to the Root object.

10.	Set the Fragments Type to Decompose and click on the Fragment button.

11.	Move Scale Preview slider right and left. 

	As you can see, the Decompose type allows to revert previous mesh combining. It detached all not connected meshes into separate objects.

12.	Click on the Delete Last button to destroy fragments.

	Now let’s shatter the Root object.

13.	Set Fragments Type to Voronoi, in Voronoi properties set Amount to 4.

14.	Open Properties disable Decompose property.

15.	Click on the Fragment button.

16.	Move Scale Preview slider right and left.

	As you can see now we have 4 fragments, but every fragment consists of 2 or 3 not connected meshes. In order to avoid adding a RayFire Shatter component to every fragment you can reenable the Decompose property.

17.	Click on the Delete Last button.

18.	In Shatter component enable Decompose property back.

19.	Click on the Fragment button.

20.	Move Scale Preview slider right and left.

	As you can see now there are more than 4 fragments because every fragment was decomposed and produced 2-3 fragments with separated meshes.

		Keep in mind that complex mesh has a lot of interpenetrated meshes it is 	recommended to disable Decompose property. Otherwise you may end up with a 	lot of interpenetrated objects which explode when you try to simulate them.