- Home /
The best way to sort list of gameobjects in order I need?
I have a race game and I need to activate checkpoints(triggers) in right order. I 've tried to sort list of checkpoints in order of hierarchy view through Transform.GetSiblingIndex and it worked in editor, but in Android build list had random order after sorting.
obstaclesList = obstaclesList.OrderBy(x => x.transform.parent.GetSiblingIndex()).ToList();
Is there a better solution to sort list of gameobjects in order of hierarchy view?
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to translate object using script? 1 Answer
Object's localScale 1 Answer
Distribute terrain in zones 3 Answers
Sorting a list based of a variable 1 Answer