Hey guys, I think my problem is very easy but I’m dumb.
I need to make pick up script but now when I try to pick up something only name0 is active.
for (int i = 0; i < sticksMan.sticks.Length; i++)
{
GameObject foundStick = sticksMan.transform.FindChild(name + i).gameObject;
if (foundStick.activeInHierarchy == true)
{
//???
}
else if (foundStick.activeInHierarchy == false)
{
foundStick.SetActive(true);
Destroy(gameObject);
foundStick = sticksMan.transform.FindChild(name + i).gameObject;
}
break;
}
Hope you guys help!