Spawning objects from a hit impact
This recipe is a guest tutorial. Ryan Pelcz gave me his kind permission to adapt his solution to spawning objects as a result of impacts upon another object. Imagine a vending machine that spits out plastic balls full of sweets each time it is hit. This is the kind of scenario we're going to create. The goal is to introduce the concept of placeable actors, spawnable actors, actors taking damage, and applying impulses to rigid bodies.
How to do it...
The placeable actor :
We have to code a placeable actor because it will have functionality a regular StaticMesh placed in the scene wouldn't have, which is the ability to produce other objects. Placeable objects are added from the Actor Classes tab not the Content Browser.
Close UDK and open ConTEXT and create a new file. Choose from the drop-down Highlighters list which says Text Files the item UnrealEd so that text we'll type is format friendly for UnrealScript.
The code starts:
class MyPowerCore extends Actor...