0 votes

Latin user, if you can answer in Spanish, I would appreciate it.
Usuario latino, si puede responder en español, se lo agradeceria.
I'm following the tutorial of the latest version, so this should go well, but no, I'm new, and I've had problems with the indents, I can not find detailed information or examples of how I should use them correctly, so I downloaded the project already finished that provides the documentation page, I compared, there was not much difference, to confirm, I copied and I pasted the final code, and even so, it still gives me error.
If I try, for example, to change the indent, eliminating a >> before $ AnimatedSprite.play () --- Line 21 --- I get the error: Parsing expression, mispaced: else, that no idea what I mean.
To be new and to fail in something that should be simple is a headache, help me please.

image 1

image 2

asked Aug 12, 2018 in Projects by Jose Romero (15 points)
edited Aug 12, 2018 by eons

Edited your post to see the links, google does not seem to like direct linking

1 Answer

0 votes
Best answer

As you can see, the indentations are wrong, one tab == one space, and there are lines with many mixed tabs and spaces.

Fix the indentation, use tabs only.

And the line with the error is closing the previous if (lower indent) so the else is wrong.

Como puedes ver, la indentación está mal, un tab == un espacio, y hay líneas que mezclan varios tabs y espacios.

Arregla la indentación, usa tabs solamente.

Y la línea con el error está cerrando el bloque del if anterior (la indentación es menor) así que el else está mal ubicado para el intérprete.

answered Aug 12, 2018 by eons (7,182 points)
selected Aug 28, 2018 by Jose Romero

Expanding on this for others who might be searching for this problem: it is legal to use tabs or spaces, you just have to be consistent. I personally don't like tabs, so I went to the Editor menu, Editor Settings, Indent, and changed Type to Spaces. If you have a mix in a file and you need to convert them, under the Edit menu you can find "Convert Indent to Spaces" (or Tabs).

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.