Having imported a bomb model into our project, we used a 100-times smaller (scaled 0.01) version to create a prefab for our game. Before saving the small bomb as a prefab, an instance of the BombBehaviour.cs C# script class was added as a component of the GameObject, and its public Explosion Prefab property was linked to the explosion prefab we created in the previous recipe.
A second script class called BombFeature.cs was added as a component to PlayerArmature, and its public Bomb Prefab property was linked to our new small bomb prefab. Since the starter assets our project is based on use the new Unity input system, we needed to write if (Keyboard.current[Key.B].wasReleasedThisFrame) to detect the B key being pressed and released. We also needed to add a using statement to import the UnityEngine.InputSystem package.
The feature we added used BombFeature.cs in ThirdPersonController to detect when the player presses the B key...