Append values to dictionary

Godot Version

4.2

Question

How to add new keys/values to a dictionary type metadata using gdscript

Sem título

You can just access a new key as if it was already in your dictionary:

var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
points_dict["Blue"] = 150 # Add "Blue" as a key 

(documentation)

1 Like