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.
To start off, let's open up the level we created in the Chapter 5, Building Encounters (
Chapter 5_5_ HealthPacksPickups.unityin the example files you can get from the Packt Publishing website).
Create an object to represent our barrel. To do this, go to GameObject | 3D Object | Cylinder.
This will create a 3D object that will look like a cylinder and give it a collider so that it blocks our player if he/she walks into it. It can also be hit by bullets.
Change the object's name to
Barrel. The default cylinder is a bit too large to be a barrel, so we will change the Y value of the Scale property to
.75. Then, we will position it so that...