- Home /
Need an addition to code that subtracts (itself + 0.16) from x?
So I copied this from my code. How can I subtract (x + 0.16) from x and (y + 0.16) from y?
if(tileColors[x+y*levelWidth] == NcolWoodOneColor)
{
Instantiate(NcolWoodOneTile, new Vector2(x, y) * tileSideLength, Quaternion.identity);
}
if(tileColors[x+y*levelWidth] == NcolGrassOneColor)
{
Instantiate(NcolGrassOneTile, new Vector2(x, y) * tileSideLength, Quaternion.identity);
Comment
Answer by 0V3RR1D3 · Nov 12, 2014 at 09:22 PM
x-=(x+0.16) y-=(y+0.16)
Im not sure if that is what you mean. I Do not fully understand the question.
Answer by Jeff-Kesselman · Nov 12, 2014 at 09:22 PM
Uh.... as you state it
x= -0.16;
y= -0.16;
This is basic algebra... x-(x+0.16) = x-x-0.16 = (x-x)-0.16 = (0) -0.16 = -0.16
Tried what??? Show us your code. You have syntax errors.
Instantiate(NcolWoodOneTile, new Vector2(x * tileSideLength -((x /2) + 0.16), y * tileSideLength -((y /2) + 0.16)), Quaternion.identity);
}
if(tileColors[x+y*levelWidth] == NcolGrassOneColor