O'Reilly logo

Building an FPS Game with Unity by John P. Doran

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

Building an explosive barrel

One of the first things we are going to look at is the common FPS staple: explosive barrels. These will allow the player to get a "leg up" on their enemies by causing explosions when damaged enough. They're also fairly simple to create.

  1. To start off, let's open up the level we created in the Chapter 5, Building Encounters (Chapter 5_5_ HealthPacksPickups.unity in the example files you can get from the Packt Publishing website).
    Building an explosive barrel

    Let's get the implementation of the functionality to work correctly, then we can make it look nice.

  2. Create an object to represent our barrel. To do this, go to GameObject | 3D Object | Cylinder

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