+3 votes


There is a way to export a Dictionary type to inspector?

I do this:

export(Dictionary) var Configuration = {
    Time = 1.5

But Inspector is not showing Dictionary keys:
Inspector is not showing Dictionary keys

If I use an Array export export (Array) var Test, the inspector show the Dictionary option to be selected:
inspector show the Dictionary option to be selected

But I can't set any key/value to the Dictionary:
can't set any key/value

in Engine by (148 points)
edited by

3 Answers

0 votes

According to documentation you cannot export dictionary. I guess you can open github issue about that if you think this would be useful.

by (368 points)
0 votes

Hi I also needed to export a dictionary, but what I did was export the array like you did, and then increased the size in the editor, and scrolled to the bottom of the list to find Array, RawArray, IntArray, StringArray Vector2Array, Vector3Array and ColorArray. So essentially it becomes arrays inside an array, which is more or less a dictionary. Did the job for me .. !!! Hope it helps you too !!!

But yeah a dictionary would be much better. I hope and I think they have planned for the future, maybe it will be there in v3.0

by (14 points)
edited by

Hi AKashyap86.

Thanks for the idea !!

+1 vote


I already opened an issue for this: Edit on Inspector an exported Dictionary

by (148 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 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 webmaster@godotengine.org with your username.