Archive 17/01/2023.

[SOLVED] Urho3D Editor - Run script feature

Alex.B

I’m using “Run script…” command in the editor to change my scene. It is works fine, but I can’t define any functions or classes inside such script - only plane code. Can anybody explain me - is it known limitation or somethilg else?
My script loks like:

void processNode(Node@ node)
{
	// do something
}

for (uint i = 0; i < scene.numChildren; ++i)
{
	Node@ childNode = scene.children[i];

	processNode(childNode);
}

Console show ERROR: 1,6 expected ‘;’

Thanks.

cadaver

This is a limitation of the AngelScript immediate execution. It already encloses your code in a dummy function, so it should just contain isolated statements, not define more functions.

Alex.B

Clear now.

Thanks.