Create a Loot System in Unity

2D Mobile Game

Objective: Create a loot system where enemies drop diamond with different gem value upon death.

When the enemy dies, instantiate the diamond at the enemy position and set the diamond value to the one defined with respect to the enemy.

Now inside the diamond script, we set the gem value and when the player collects the diamond, player gets either the default diamond value if it was generated by itself or a defined value if it was generated after enemy death.




Unity Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Budgeting for an App Development Project

A Little Story about MaximusNAS

Exploring itertools module in Python

Layman’s Guide to Performance Tuning

Integration testing of APIs in Spring-Boot( Java) with Junit | For Beginners

Integrate Shopify into your Strapi Website

Product Review: Is Router Rebooter the answer to all your internet connection issues?

Mathematics in coding

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Niraj Karki

Niraj Karki

Unity Developer

More from Medium

Loading Scenes In Unity

Adding a thruster speed boost on keypress

Level Design in Unity 3D Part 6: Colliders

Command Pattern in Unity