Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | D | |
Old Version | Published before Godot 3 was released. |
Is their any way to concatenate variable names at runtime? I would like to be able to set variable’s in loops. As example.
var a0 = null
var a1 = null
for i in range(1):
ai = 5
Where ai would be the concatenated variable. I can’t find any way to make it work.
Thanks.
D
For that specific case, why not just use an array?
var a = [null, null]
for i in range(1):
a[i] = 5
Could you provide an example where using an array wouldn’t be nice?
raymoo | 2017-03-10 19:19