I have a crafting script for some reason im not getting the Debug.Log(“Ammount1”), Debug.Log(“Add”), or Debug.Log(“Add1”), but i am getting Debug.Log(“Ammont”).
I think it has something to do with the brackets that i placed but because im pretty new to Unity and Javascript, I dont really know what way they should go. I think it is the Brackets because im its not subtracting the Ammount variables. If you know what the problem is or what i need to do to keep it working but rearrange the brackets please leave a comment or an answer!
I have left the section of the script below. I am sorry im not very knowledgeable in coding and Thank you in advance!
function Craft2 ()
{
if(Crafting[2] == true)
{
Debug.Log("Ammount");
if(Ammount[0] >=2 && Ammount[1] >=1)
{
if(CraftingNumber >= NewTexture.Length)
{
Ammount[0]-=2;
Ammount[1]-=1;
Ammount[2]+=1;
Debug.Log("Ammount1");
if(NewTexture[CraftingNumber] != Blank )
{
CraftingNumber ++;
Debug.Log("Add");
}
if(NewTexture[CraftingNumber] == Blank )
{
NewTexture[CraftingNumber] == AllTextures[2];
Debug.Log("Add1");
}
}
if(CraftingNumber < NewTexture.Length)
{
CraftingNumber = 0;
Crafting[2] = false;
}
}
}
}