I have such a function
public void SetChoice(int x)
{
Debug.Log(x + equiped[x].ToString());
if (equiped[x])
{
choice = x;
Debug.Log("ustawiło się");
}
else Debug.Log("nie masz itemu");
}
which is assigned to buttons in OnClick, the problem is that it works as if every element in the equiped array was false, but this is not the case when writing DebugLog in the Update tells me true every time, which is how it should be, only in this function, it doesn’t work, and when I run this function in the Update, it works fine, so the problem probably results from the fact that it is triggered by a button