0 votes

hi, how can i get item name by index in itemlist?

Godot version 3.4
in Engine by (99 points)

1 Answer

0 votes

To get the value of an Array, do

var array = [1, 2, 3, 4]
print(array[0]) # 1

To get the key ("name") of a Dictionary, do

var dictionary = {"One": 1, "Two": 2,}
print(dictionary.keys()[0]); # One
by (1,111 points)
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.