Equipment and inventory demo. Log #2

posted in Darthy
Published June 01, 2018
Advertisement

To work with inventory I certainly will need some items to pick up or equip. On my devlog website is this log about modeling an axe for my game. In that time I already had few item models in game as sword, pickaxe, hatchet and some armor. For icons of my items in inventory I use psd files, set as Sprite (2D and UI). The advantage of Unity is, that Unity works directly with psd files, so I dont have to export new files after eventual editing. After picking up the items will show in the inventory under proper panels. After selecting the item, action buttons appear under the details panel.

For equiping weapons (or tools - every tool is also a weapon, beacuse you certainly can attack somebody with pickaxe or hatchet), there are two options. Either you can equip it by clicking on button "Equip" (duh), and the weapon is going to be equipped in the right hand by default, or you can hit the key R for the same result or the key L for the weapon to be equipped in the left hand. For two handed weapons or tools like pickaxe, it automatically equips it to both hands, no matter what key you hit. When equipping two one handed weapons, just hit L and then R key on second weapon or vice versa.

For armor equipment there is obviously only button for equipping. The character consists of several separated meshes, the default set of meshes is controlled by one script, when equiping the armor only the corresponding mesh will swap for new armor mesh, after unequipping the armor, the default mesh will be set back. Default mesh is for instance clothing at the start of the game. This behaving will work also for NPCs, so they can wear different armors and change them in game. 

armor_equipment.webm

Visit Altos facebook page or devlog website.

See you in the next log. Darthy.

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement