Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3: Player Controllers, Pawns, an... > Hands-on Example: Adding a weapon to...

Hands-on Example: Adding a weapon to your pawn

In this tutorial we will be adding a weapon to the pawn from the last tutorial. The weapon will be a custom class derived from the Weapon class and fire a custom projectile that is derived from the Projectile class. We will also be creating a new InventoryManager class to manage this new weapon. Finally, in order to use this weapon we will need to modify the player controller and add code that will actually fire the weapon.

Creating the Weapon

Create a new file called “JazzWeapon1.uc” with the following code. The new class JazzWeapon1 is our custom weapon.

We are going to add to the code from the previous example so all code for this example will go to the Classes directory at:

C:\UDK\UDK-2011-06\Development\Src\ExampleCh31

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial