Add a collision object

Adding a collision object

Setting the collision logic
The last step in Blender is adding a collision object to the sword so it won't go though the ground or other objects in game when you throw it.
Blender has an script that creates automatically collision objects for a selected mesh:
- Select the sword
- In Edit Mode select the menu option Mesh -> Scripts -> Hull as shown in the Adding a collision object picture.
- Select the option you prefer. If your sword has a complex shape, like in the example, select Convex.
- Press the OK button and accept the default precission (0.100).
- Wait while the script works and when it has finished you'll see a pink object that surounds the sword: that is your collision object.
Once the collision object is been created, select it and in Object Mode:
- Press the Object button (or the F7 key) and check that the value of Drawtype is equal to Bounds and that the value of Draw Extra is equal to Wire.
- Press the Logic button (or the F4 key) and in the area shown in picture Setting the collision logic:
- Set the type of collision to Dynamic, set a value for the mass (7 in the example) and check that the radius (the dotted sphere in the picture)is right: neither too big nor too small.
- Check that the button Bounds is press and that the polygon type is Convex Hull
- Press the Add property button and fill the three boxes that appear below it as follows:
- Select String in the first box
- In the second box, that already contains Name:prop type HavokMaterial. Once you've done this in this second box you'll see Name:HavokMaterial
- In the third box type HAV_MAT_METAL (if you want your sword to sound as metal. If you want it to sound as stone type HAV_MAT_STONE, if you want it to sound as wood type HAV_MAT_WOOD)