O'Reilly logo

Unity Game Development Scripting by Kyle D'Aoust

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

Removing items

Now, we'll add the second most important aspect of inventories, removing items! This is handy for those times when a player uses their health potion, sells an item, shoots a rocket, or drops their coins!

Let's figure this out

Just like we did when we added items, let's take a moment to think about how we want to remove items from the inventory. Again, from the player's point of view, how is this done? Well when they sell the item, they are selecting the item personally. If the player shoots their gun or bow, their ammo is dispensed immediately. When the player meets their untimely death, their items may be dropped on the ground or left on their corpse to be looted by their assailant. During the selling item phase and shooting gun ...

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