Hello, I am making something like football league where I will bet and earn money and so on. But I am stuck when making an schedule. I want to move a team up or down in schedule when lose or earn points, but I really don’t know how to do that. I tried a few options, but none of them worked. Please, can someone give me an example of code how to make something like that? Thank you so much
What have you tried so far? If you’re using the UI system you could just use a LayoutGroup component and then use this to set their position in the hierarchy. Just sort your list of teams by their score or whatever other metric you are using to sort them (I’m not a big sports fan, clearly ) and pass their index to that function, so the order reflects that of your internal data structure.
1 Like
ZombieTFK’s solution is the standard one, I’d go for that. That’s what Layout Groups are for. If your teams are represented in your code by a List things will be easier for you in the long run, since you could add or remove teams from the list and pass that info to the UI. But anyhow, that’s not in the scope of the question.