07-03-2014, 06:45 PM
That code looks fine. However, if I remember right you can't be sure that Transform.GetChild() gives you the gameobjects in the order you see in the hierarchy window (add a quick debug.log() to your loop to check that). Unity 4.5 adds the possibility to define the order in the hierarchy window itself (as well as by code). The "alphasort" script I linked forces Unity to use the "old" Unity sorting style.
So you have to do two things:
- add the script I linked somewhere in your project
- ensure you read your input nodes in right order
Jake
So you have to do two things:
- add the script I linked somewhere in your project
- ensure you read your input nodes in right order
Jake