CHAPTER 16

Image

Unity: Creating Inventory Systems

Thus far we have created several weapons and tools (our flashlight, EMP, and pistol). However right now, in order to use any of the three, they have to be activated in the script manually before running the game. This, of course, is a useless method to the player. What we need to do is create an inventory system that allows the player to choose which tool he wants to use and when. This inventory system will also do the work behind the scenes of turning various tool functionality on and off in the scripts.

Right now, the gun is active even when placing an EMP. The flashlight is shining even when the ...

Get Creating Games with Unity and Maya now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.