I made a little script to instantiate a random item when you kill an enemy, but there’s a problem with the randomization.
hpma = Random.Range(1,2);
if (hpma == 1)
{
pickup = pickup1;
}
if (hpma == 2)
{
pickup = pickup2;
}
Instantiate(pickup, transform.position, Quaternion.identity);
It mostly works fine, but it always instantiates pickup1. What do I need to change?