Do for loops work in shaders for godot 3 alpha 1?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Smellyhobo101
:warning: Old Version Published before Godot 3 was released.

I tried this code:

shader_type canvas_item;

void fragment() {
	for (int i, i < 10, i++) {
		float asdf = 1.0;
	}
}

I get this error:

error(4): Expected expression, found: CF_FOR

Is there something wrong with my syntax or are for loops not implemented yet?

:bust_in_silhouette: Reply From: Zylann

Try to write for (int i = 0; i < 10; i++) ? (with semicolons)
If it doesn’t work you could report an issue on Github, because for loops are supported in the underlying GLSL.

Tried with semicolons as well and I get them same error. I guess I’ll create an issue for it.

Smellyhobo101 | 2017-08-22 18:27