Typically, in a game, the player will be able to collect power-ups to increase their effectiveness, or to replace depleted life or energy.
In this game, our player will collect food to boost his health. This stage will involve adding a collectable and making the player react with a suitable animation sequence.
Our first collectable is already set up as a prefab in the project files, making it easy to drag and drop into our game level without having to add components and set variables:
Pickupssubfolder and locate the
lunchBoxinto the Hierarchy panel to instantiate ...