0 votes

I tried editing a dictionary in the inspector, and while you can easily edit the value after clicking "Add Key/Value Pair", it seems to be impossible to edit the key without removing the item and making a new one.

in Engine by (22 points)

1 Answer

+1 vote

I dont think you can do that but you can add a new key with the same value and delete the old one

dict["New_Key"] = dict["Key_To_Change"]
dict.erase("Key_To_Change")
by (1,635 points)

I was hoping for an answer that was less inconvenient. I guess just editing the dictionary in the script is probably the most convenient option.

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.