- Home /
Question by
iamthecoolguy11 · Jun 26, 2014 at 03:07 AM ·
c#arrayselect
How do I select all other arrays
I am trying to make a simple inventory and I want all the arrays that arnt in my hand to do something else.
public int e;
public GameObject items[];
public Transform Hand;
public Update()
{
if(Input.getKeyDown(keycode.t))
{
items[e].transform.position = Vector3.Lerp(items[e].transform.position, Hand.position, step);
items[e].transform.rotation = transform.rotation * Quaternion.Euler(0, 90, 0);
}
//trying to tell all other arrays(items) to do this besides [e]
if(Items[])
{
//do somthing
}
}
I left some of the code out to shorten it
Comment
Best Answer
Answer by AndyMartin458 · Jun 26, 2014 at 03:29 AM
for(int i = 0; i < items.Length; i++)
{
if(i != e)
{
//do something
}
}