Breakable Object
1. Draw out a brush for the size you want your object. (See this tutorial if you don't know how to draw brushes.)
2. With your brush still selected, right-click on any of the 2D views, and choose 'func/func_explosive'.
***OPTIONAL***
3. With your brush selected, press N to open the Entities dialog box. The top window here should have 'func_explosive' selected, the middle window gives you information on what Keys/Values you can use, and the lowest window is where you enter information to change how the object will act. In the Key field type 'health', then press Tab to jump to the Value field and type '1', then press Enter. This will make sure object act as fragile glass, being destroyed instantly with one knife slash or bullet. Let's also enter the Key 'type' and the Value 'glass' and press Enter. This makes glass debris appear breifly after you destroy the item, and you'll hear a glass smashing sound (you'll obviously want to add a transparent shader to make the brush look like glass too, See this tutorial if you don't know how to apply textures/shaders). In the middle window there are many other Keys listed you can test out, along with a brief description of their function, so go and experiment!
That's it! Now you can go and test out your breakable object. In game, an icon should appear when you are close to the object, indicating you can break/shoot it. The blue bar underneath this icon shows how much health the object has. (See this tutorial if you don't know how to compile and test maps.)
|