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 a landmine

The explosive barrel is a nice touch in any environment, but let's build something for a more specific application. What if we were to set a trap and have it spring when a character comes within a close enough proximity? Even better, a landmine in an open environment like a battlefield.

With that in mind, let's get to building a landmine that detonates when touched.

Getting ready

Open your IDE and start by creating a new class called Landmine and have it extend from ExplosiveBarrel.

Because our mine is an item that will probably be heavily used by a level designer, let's again hide many of the properties from the editor, as it will just clutter up the screen. Hide Movement, Attachment, Debug, Advanced, Mobile, and Physics.

We also ...

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