How to insert an index in a {} array?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GeorgeLovesJesus

Hello there!
I have a save file system and I want to insert an index to a {} array for everytime I load a node.
Everything is going fine but the insert function only seems to work on arrays and not on {} arrays.

Just so you know, something like:

x = {}

is called a Dictionary :slight_smile:

SF123 | 2022-05-08 15:57

:bust_in_silhouette: Reply From: Inces

You can read about diciotnaries in in-editor documentation. Generally You add new elements like this :

var dict = {}
dict["index"] = 1

after this operation dict becomes :

dict = {"index" : 1 }

if entry already exists, its value will be changed. If entry doesn’t exist, it will be created with following value

So simple haha, that I ask God to bless you!

GeorgeLovesJesus | 2022-05-07 18:14