UDK already has a homing rocket launcher packaged with the dev kit (UTWeap_RocketLauncher
). The problem however, is that it isn't documented well; it has a ton of excess code only necessary for multiplayer games played over a network, and can only lock on when you have loaded three rockets.
We're going to change all of that, and allow our homing weapon to lock onto a pawn and fire any projectile of our choice. We also need to change a few functions, so that our weapon fires from the correct location and uses the pawn's rotation and not the camera's. These are the same functions which we added to our ShockRifle
class in Chapter 3, Scripting a Camera System. We'll need to create two classes for this first, so let's get started!