Invalid get index '0' on base Array

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ROBOTOO007

i basically used a line of code that I used in a python project in my godot project since the 2 languages are similar i thought it would work but for some reason it’s gving me an error can someone help me with this:

var map= [[EMPTY for x in range(0,map_size.x)] for y in range(0,map_size.y)]

GDScript does not support Python list comprehensions. You should read the GDScript documentation; if you don’t, you’ll keep running into problems thinking that things that work in Python should work in GDScript, too. There are actually huge differences between the two languages; GDScript is tiny compared to Python.

archeron | 2020-05-18 12:02

:bust_in_silhouette: Reply From: RazorSh4rk

gdscript is not python

:bust_in_silhouette: Reply From: deaton64

try this: How do I create a 2D array ?