Giving the car a weak spot
From the Creating a new car XML recipe, we skipped the Damages and Components section of the XML. Now it is time to return to that section and give this car a weak spot.
Getting ready
Complete the Creating a new car XML recipe. Then open MyVehicle.xml
in Notepad or an equivalent editor.
How to do it...
We need to first create a new cell in between
<Physics>
and<Components/>
. Copy the following code snippet to that location:<Damages submergedRatioMax="0.6" submergedDamageMult="1" collDamageThreshold="10" groundCollisionMinMult="1.3" groundCollisionMaxMult="1.4" groundCollisionMinSpeed="8" groundCollisionMaxSpeed="22"> <DamageMultipliers> <DamageMultiplier damageType="bullet" multiplier="0.125"/> <DamageMultiplier damageType="collision" multiplier="1"/> </DamageMultipliers> <DamagesGroups> <DamagesGroup name="Destroy" useTemplate="CarDestroy"> </DamagesGroup> </DamagesGroups>...