I need to create an array with each item having multiple properties e.g. actor + float, so I started to use a Struct which works fine. However as the float may differ each time I can’t just use array find because of the change. I don’t really want to create a second array with maybe a name or something to ID it and then get the index, also without looping through each item just to find a specific one that has a matching variable.
Try utilise the array index to store as a named ref.
Alternatively if there’s too much looping/iteration and you *really *want to use a variable in your struct as a key to find(); you can create a dictionary.
Initialise the new Dictionary variable first with **key **: **struct **
where **key = **Name
and **struct **= YourStructure
I would create a function mapArrayOfStructToDictionary(struct, StructVarAsKey).
You need to ensure every value is unique else the dictionary item will be removed. Now decide if a data table is better where you enforce unique keys