I want to change the position of the children inside the container.
For example put the last one on top
How can I do it?
I created like this:
Thank you very much!
I want to change the position of the children inside the container.
For example put the last one on top
How can I do it?
I created like this:
Thank you very much!
Looks like you may either be looking for the top scoring player or the player on screen looking for their name in the top of the list?
In either case it’s best to keep these scores replicated on the player state set by a server event.
In the case of high score you can get the game state-> player array-> for each each loop and cast to each player state and get the player score and set a temporary integer or float variable that starts at zero and off each iteration of the loop check if the player state score is greater than the temp variable.
If true set the temp variable to that score and store that player in an array with an index of, say zero. If the remaining players have a higher score give them the zero index and place the remaining players in the array at any other index. Run a for each loop off that newly created array and add the remaining children to the box. The latter children won’t be in order though without further code.
If it’s the player on screen wanting to be at the top you can run the player array and compare the player state to self and if true set that as a variable and add the child to the box and run it again and omit that player state variable and add the remaining children.
Hi.
Yes, your idea works. Organize the data instead of organizing the children.
And also i can order all the data from largest to smallest.
I don’t understand why it is not possible to move the children.
I think everything would have been easier that way and using the mapped dictionary.
Thank you so much for your help!!
Very appreciated!!