I created one text object “NewText” and assigned the variable “ID”.
Then I moved the object to the scene and duplicated it 4 times.
For each object on the scene, I changed the value of the “ID” variable.
I have created an array “Array” and a global variable “Index”. There are 4 child variables with different values in the array.
The text on the scene will display values from the array depending on the variable “ID” of the “NewText” object. The global variable “Index” will change depending on the key pressed by the user.
If the “Up” key is pressed - subtract 1 from “Index”
If the “Down” key is pressed - add 1 for “Index”
(and the “Arrow” object, which I did not specify, changes position).
Yes, this is the mechanics of selecting an option using the keyboard, not the mouse.
Then I created a list of events:
When the user clicks on the “Left” button, the value of the child variable is subtracted depending on the global variable “Index”.
And for this, I have to specify a specific element from the array.
Is it possible to change the value without specifying a specific element from the array?