Hello,
I just implemented this solution:
It works good but when I trigger an item drop, all items of the dropped type get their Attribute updated to the same value.
The IDs of the items are different.
Setup of my enemy
Enemys inventory:
The items Axe and Sword are unique and mutable by their category:
The Drop() function is called from a custom health script.
In start() : crd = gameObject.GetComponent<CustomRandomDropper>();
In kill(): crd.Drop();
Sword from scene before triggering the drop has ID: 4261020585, Rarity: Rare, BaseAttack: 10
Sword from scene after triggering drop: ID: 4261020585, Rarity: Common, BaseAttack: 1
Sword that got dropped: ID: 906641182, Rarity: Commin, BaseAttack: 1
Also the items get dropped in stacks, so if I set Min Amount of 5 and Max Amount of 10, there will only be 2 items dropped with the total amount of 5-10, so for example 3 swords in a Stack and 2 Axes in a stack. I expected 5 unique item drops with different values.
I just implemented this solution:
Custom Random Item Dropper - Opsive
In many RPG games, like Diablo or Destiny, when an item is spawned it is given random stats. Those random stats could depend on many . . .
opsive.com
It works good but when I trigger an item drop, all items of the dropped type get their Attribute updated to the same value.
The IDs of the items are different.
Setup of my enemy
Enemys inventory:
The items Axe and Sword are unique and mutable by their category:
The Drop() function is called from a custom health script.
In start() : crd = gameObject.GetComponent<CustomRandomDropper>();
In kill(): crd.Drop();
Sword from scene before triggering the drop has ID: 4261020585, Rarity: Rare, BaseAttack: 10
Sword from scene after triggering drop: ID: 4261020585, Rarity: Common, BaseAttack: 1
Sword that got dropped: ID: 906641182, Rarity: Commin, BaseAttack: 1
Also the items get dropped in stacks, so if I set Min Amount of 5 and Max Amount of 10, there will only be 2 items dropped with the total amount of 5-10, so for example 3 swords in a Stack and 2 Axes in a stack. I expected 5 unique item drops with different values.