How to demolish object after several collisions

1.	Create Cube, this will be the cube which will be demolished in runtime. 

2.	Set its name to "Brick", position to [0,10,0], rotation to [0, 0, 20] and scale to [2,1,1]

3.	Remove it's Box Collider because Rigid component will add its own collider.

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

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

6.	Add RayFire Rigid component to Brick.

7.	Set Rigid Initialization to At Start.

8.	Set Simulation type to Dynamic.

9.	Set Object type to Mesh..

10.	Set Demolition type to Runtime.

11.	Start Play Mode.

	Bricks fall down and demolish at first contact. Solidity property defines whether an object will be demolished at collision or not, but in some cases you may need to collect collision damage and demolish objects after several collisions.

12.	Turn Off Play Mode.

13.	In Limitations properties set Solidity to 10 so Brick won't be demolished by single collison.

14.	In Damage properties turn On Enable property and under Collision caption enable Collect property.

15.	Set Max Damage to 50. This value defines how much damage an object can take before will be demolished. 

16.	Start Play Mode.

	Bricks fall down without being demolished because now it has high Solidity. Notice that Current Damage value has increased from 0 to about 25. One collision not enough to reach max Damage value.

17.	Turn Off Play mode.

18.	Create a Sphere object.

19.	Set its name to “Small Sphere” position to [0, 12, 0] and scale to [0.2, 0.2, 0.2]

20.	Add RayFire Rigid to the Small Sphere object.

21.	Create another Sphere object.

22.	Set its name to “Big Sphere” position to [0.5, 13, 0] and scale to [0.5, 0.5, 0.5]

23.	Add RayFire Rigid to the Big Sphere object.

24.	Start Play Mode.

	Bricks fall down without being demolished and it’s current damage value now is about 25.

25.	Select the Big Sphere object and in the RayFire Rigid component click on Initialize.

26.	Select Brick object. Notice that after collision with Big Sphere it’s Current Damage now about 42.

27.	Select the Small Sphere object and in the RayFire Rigid component click on Initialize.

	Sphere falls on the Brick object and demolishes it because Brick’s Current Damage property finally exceeded Max Damage property value. Playing with Multiplier property you can multiply applied collision damage. Another way to demolish an object by damage is to shoot it using a RayFire Gun component but this will be covered in another How-To.