Create Objects by letters from text

Hello. I’m interested in finding the simplest way to create objects from the letters present in a text (for example, in a variable). Let’s say we have objects named A, B, C, and D, and we have a string variable containing the text “ABCD”. Now, I want a function that will enable us to recognize each letter in the variable so that we can create objects based on those letters’ names. This means that if, for example, the variable contains the text “AB”, I want Object “A” and Object “B” to be created. Thank you.

You can use
StrAt(string, number) “get character from a text”
StrLength(string) “length of text”

The first character of a string is in position 0.

https://wiki.gdevelop.io/gdevelop5/all-features/string-instructions/reference/

variables:

events: