Enum to int issue

I am attempting to put my character generator together. I’m pulling the enum values from the attributes script and want to display them as a string. The error that comes up is- cannot convert type to int. The more I try to fix it, the more it come up with problems.

for(int ctr = 0; ctr < Enum.GetValues(typeof(Attribute)).Length; ctr++){

	GUI.Label(new Rect(10, 40+(ctr * 25), 100, 25), ((Attribute)ctr).ToString());


What am I doing wrong?

You need to cast the ‘Enum.GetValues’ back to an int:

for(int ctr=0; ctr < (int)Enum.GetValues(typeof(Attribute)).Length; ctr++){
    GUI.Label(new Rect(10, 40 + (ctr * 25), 100, 25), ((Attribute)ctr).ToString());