0 votes

Hi all,

I'm trying to do the following:

func setup_board():
    for x in range(5):

... but I get this error:

Invalid operands 'Array' and 'int' in operator '*'.

Can anyone point to what's going wrong here? I understnad it's saying something like I can't perform a multiplication on an Array but I'm doing a python tutorial and this works in Python. In that case, how would I do it in GDScript? I should probably note that I'll be replacing 'O' with a sprite in time. This is just a quick prototype.

BTW, in Python this is the output and what I'm basically trying to achieve:

['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']

Any advice greatly appreciated.

in Engine by (828 points)
edited by

1 Answer

+1 vote
Best answer

Hi, this issue has already been discussed:

by (283 points)
selected by

Thank you, much appreciated and sorry I didn't see that one earlier.

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.