O'Reilly logo

Getting Started with Unity by Patrick Felicia

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 and displaying an inventory system

In our game, in addition to med packs, we will be able to collect other types of objects. We will then need to keep track of these objects using variables and graphical representations. This can be done using a basic inventory system. Some objects will have an effect on the player (for example, increase health), while other objects will be used at a later stage. To keep track of these objects we will need to create corresponding variables, update these variables when the corresponding objects have been collected, display a graphical representation of the object(s) collected, and modify the players' attributes (for example, its health). We will be working with the script collisionDetection. First, let's ...

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