I’m trying to make a Cube Based map, that generate random Coords at Y, that makes mountains.
so, this is my simple script:
for(int j=0;j= HScale(horizontal scale) it stops. but, it only complete 1 loop, my HScale var is 16, anyone could help me with this? who i’m doing wrong?
Sry for my bad english, i’m still on college, and i’m brazilian.
The problem is already visible in your title. In the syntax of C#, statement blocks like if()
, for(;;)
, while()
or function declarations etc. don’t need a semicolon.
A for-loop executes the statement or statement block following the for(; line.
In your example you have accidentally put a semicolon right after for loop and that counts as an empty statement.
for(int j=0;j<HScale;j++)/**this empty statement gets executed in the loop*/;
{
// this is your statement block but the for-loop doesn't apply to it
}
How about for(int j = 0 ; j < HScale(horizontal scale); j++){} You cant have “=” on your second argument.
PROBLEM SOLVED. the “z” var just don’t increase with +=1; i need to do z++; thanks dudes