renman, you’ve replied to a lot of my posts. 0 of those have helped me in any way. You think I can’t read the error and tell there’s something wrong with line 16?
After much deliberation, I have decided that checking the contents of slot1 twice was a typo, and that you wish for it to break after one is found. Here is what the above looks like with arrays:
private var slots : int[];
function OnCollisionEnter (collision : Collision) {
if (collision.gameObject.tag == "Iron Sword Entity") {
for (var i : int=0; i<slots.Length; i++) {
if (slots[i] != 0) {
slots[i] = 1;
break;
}
}
}
}
private var slot1 = 0;
private var slot2 = 0;
private var slot3 = 0;
private var slot4 = 0;
private var slot5 = 0;
private var slot6 = 0;
private var slot7 = 0;
private var slot8 = 0;
private var slot9 = 0;
private var slot10 = 0;
Please, don’t get me wrong. I am a noob myself. Can you image how often I mix up = and == ?
That happens to the best of us, I think
I still do tutorials, this isn’t just for idiots. Tutorials are for people who wanna learn stuff. And believe me you in particular have to do a lot tutorials. But me too.
Everybody overlooks little mistakes… Markus speaks the truth. I would advise on using an InventoryItem class to show item values like durability, damage, and stuff like that, then make an array of GUI Buttons to display the items to equip/unequip.