- Home /
Question by
Broken Crayon Games · Feb 13, 2015 at 07:17 PM ·
for-loopparser
Parser Error in For Loop
This one is (hopefully) a very simple question, as I just need an extra set of eyes. Can anyone spot the parser error in the code below? All variables are properly defined and the original instance of the error occurs in the for loop below the "<" sign.
Any help would be greatly appreciated.
public void AddModelSelectionDisplay(int id)
{
scrollPosition = GUI.BeginScrollView(new Rect(0, 0, modelRoladexRect.width, modelRoladexRect.height), scrollPosition, new Rect(0, 0, modelRoladexRect.width, 60*availableModels.Count));
for(int i = 0, i < availableModels.Count; i++)
{
GUI.Label(new Rect(0, 60*i, modelRoladexRect.width, 60), availableModels[i].name);
}
GUI.EndScrollView();
}
Comment
Best Answer
Answer by Doireth · Feb 13, 2015 at 07:19 PM
You're missing a semi-colon
for(int i = 0, i < availableModels.Count; i++)
should be
for(int i = 0; i < availableModels.Count; i++)
hahahaha - thank you! Extra set of eyes does wonders after a few days writing code.
Your answer
Follow this Question
Related Questions
for loop not working properly 0 Answers
Unexpected Symbol `:' expecting : 2 Answers
More than one row in an array not displaying in a FOR loop 2 Answers
using "for" in Unity Script HELP! 2 Answers
Difference between if statement, while and for loop? 4 Answers