Hello, I can’t get my for loop working, this is the code:
public int test = 1;
IEnumerator RotateWheelLeft() {
for (test i = 0; i = 50; i++) {
// stuff
}
}
The error is: CarScript.test' is a
field’ but a `type’ was expected
Thanks, Andreas
Khada
2
test i = 0; //only makes sense if ‘test’ is a type that can be set to 0
int i = 0; //an int is a type that can be set to 0 and used as a loop counter
All variable declarations use the following structure:
//type name = value
int num = 0;
for (int i = 0; i == 50; i++) {
// stuff
}
// You need to add two equals