Flexible LOOT SYSTEM in Unity with Random Drop Rates

preview_player
Показать описание
Loot makes exploring and killing all of those enemies really worth it. Everyone wants a reward.

In just 2 simple classes and a few lines of code you can setup a powerful loot system that lets you dynamically set drop rates and loot tables on individual GameObjects using Scriptable Objects and Random Number Generation.

Build the foundation for any loot system you'd want to incorporate in your game in a few minutes.

✨Want to support the channel?

➤SUBSCRIBE to become the very best game dev, like no one ever was 💘

➤LIKE the video if you enjoyed, it really helps the channel!

We have channels to help you with your problems!

Thanks for watching!

#bmo #unity #tutorial #loot
Рекомендации по теме
Комментарии
Автор

A book, a fish, and a gem walk into a bar….. and Bmo’s at it again with that good content

mandamoon
Автор

Great lesson here. Very clearly shows the fundamental to getting an RNG loot system in place.

snman
Автор

Soo useful, I will definitely going to use this for my next school proyect, thank you so much and keep up your amazing videos. Really helps me and other beginners a lot.

arturoescobar
Автор

Very nice!
And now I'm gonna steal it.
Thank you!

SelaMalka
Автор

Im so lucky that i picked up Unity again after years during the time u have started uploading content mate

nikaman
Автор

At right place, at right time! Thx for tutorial)

Філіпс-йш
Автор

Fantastic video. I saw a few comments below asking how to differentiate the items since they all drop from the same prefab. For example in my game I want the items to have a different effects when the player picks them up. I added this line of code to your script under the InstantiateLoot function in the LootBag script to add a tag to the prefab depending on what the lootName is. From there you can just add an onCollision function in the player script to react to the tagged item. Hope this helps

public void InstantiateLoot(Vector3 spawnPosition)
{
Loot droppedItem = GetDroppedItem();
if(droppedItem != null)
{
GameObject lootGameObject = Instantiate(droppedItemPrefab, spawnPosition, Quaternion.identity);
= droppedItem.lootSprite;

//assign tag function
if(droppedItem.lootName is "Shield")
{
lootGameObject.tag = "Shield";
}
}
}

spd
Автор

Epic Video, Just found your channel, trying to figure out some stuff, magically it appeared. Great Content!!!! Hope your channel grows

xyphelon
Автор

I've watched several of your videos.
This is the one that got me to subscribe. Thank you for this. Simple, effective and easily modifiable.

seaderwerks
Автор

Underrated channel! Keep up the excellent content

FullMealJacke
Автор

Hey man. I just found your channel and I love you tutorial style. Very helpful!

Jona
Автор

Hey, your tutorials are amazing and you deserve millions of subs.... Loving watching and learning from you so far!!

mitchellknirnchild
Автор

Great video! Very helpful! I am very enthusiastic!!!!

happyghoststudios
Автор

Very Helpfull and good Tutorial!!! Thanks a lot! It is exact what i needed

HrSkully
Автор

thanks. easy, simple, complete and concise.

CokeVoAYCE
Автор

this is a really cool way to do loot
your video's often show me better ways do do simple process and systems, all your systems are easily expandable to suit more complicated games

if you love rng and wanted to a random amount of loot to drop you could put the whole of GetDroppedItem inside a for loop and roll the limiting INT to decide how many times it roles for loot

thenubblet
Автор

hey I was just wondering how to differentiate the items from each other, since they all come from 1 prefab

Raydamick
Автор

If you want to do this in a 3d game, like me that I'm currently doing an rpg, all you have to do is change the sprite variable in Loot for GameObject

JERSCOM
Автор

You, sir, have earned my sub and like.

Kylenavyify
Автор

The only thing I found missing is putting items in a pool, just in case you have lots off loot on the screen, add a switch, then you can easily use this in your other projects

WeirdGoat