O'Reilly logo

UnrealScript Game Programming Cookbook by Dave Voyles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an army of companions

Going through a game alone is seldom any fun. We're social creatures so we enjoy the company of others. What better way to celebrate this than by creating a group of companions to follow us along on our journey? In this chapter, we'll explore how to create a small party of companions who spawn at our location and reap the rewards of our adventure!

Getting ready

Start by having your IDE open and ready to make some changes. We won't have to create any new classes, but we will alter the behavior of our existing ones by adding some functions.

How to do it...

  1. Let's begin by overriding the SpawnDefaultFor() function in our TutorialGame class. Once we spawn our default pawn, PlayerSpawned() in our player controller is to be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required