How to export fragments into mesh asset and create prefab.

1.	Create a Cube.

2.	Add RayFire Shatter component to the Cube. 

3.	Click on the Fragment button. A new gameobject “Cube_root” with fragments as it’s children will be created.

4.	Drag and drop Cube_root object from Hierarchy window to Project window into Assets folder to create prefab. Name it “Cube_root_prefab”.

5.	Drag and drop Cube_root_prefab from Project window to Scene view.

	As you can see, instantiated Cube_root_prefab doesn’t show any fragment meshes in scene view. Select one of it’s child fragment and you will see that the Mesh Filter component has no mesh, it’s Mesh field shows None. 
	This happens because after shattering all new generated mesh data stores only in scene, not in project asset. Since prefab itself can not store Unity mesh it loses all mesh data. To fix this we need to save all fragments meshes into Mesh Asset before creating prefab.

6.	Destroy Cube_root_prefab in the Scene view and prefab in the Asset folder.

7.	Select original Cube.

8.	At the bottom of the RayFire Shatter component open Export properties and set Source to Last Fragments.

9.	Click on Export last Fragments Button.

10.	In the Save Fragments to Asset window select the project folder where you want to store mesh asset and click on Save. New Unity Mesh asset will be created in a defined folder. Keep in mind that by defualt mesh asset will be saved in Assets folder.

11.	Select one of the fragments and open it’s Mesh Filter component. Click on Mesh field to highlight in the Project window it’s mesh saved in Mesh asset. Now fragment’s mesh referencing to asset and can be saved as a prefab.

12.	Drag and drop Cube_root object from Hierarchy window to Project window into Assets folder to create prefab. Name it “Cube_root_prefab_new”.

13.	Drag and drop Cube_root_prefab_new from Project window to Scene view.

	Now you can see that instantiated prefab shows all meshes in the scene window.

	In this example we created a mesh asset for last fragments, but in case you have a root with fragments which you created long ago and you don’t have an original object with Shatter you can Export Meshes by adding Shatter component to the root itself and then in Export properties set Source to Children. In this case Shatter will export all children meshes to mesh asset

IMPORTANT: It is recommended to export root with fragments into FBX asset using external plugins. Unity mesh file format is not optimized and size can be twice bigger than the same meshes stored in FBX asset.