Error CS1525 unexpected symbol '1' please help!

Here is the website;
http://noobtuts.com/unity/tower-defense-game-step-2-menu

Here is my code;

using UnityEngine;
using System.Collections;

public class Menu : MonoBehaviour {

    public GUISkin skin = null;

    public float widthPercent = 0.3f;
    public float heightPercent = 0.3f;
    
    public Texture2D logo = null;
    
    void OnGUI() {

        GUI.skin = skin;
    
        Rect r = new Rect(Screen.width * (1 - widthPercent) / 2,
                          Screen.height * (1 - heightPercent) / 2,
                          Screen.width * widthPercent,
                          Screen.height * heightPercent); 
        
        if (logo != null) {

            Rect 1 = new Rect(r.x + r.width - logo.width / 2,     // this is the line with my error, at the beginning "Rect 1"
                              r.y - logo.height / 2,
                              logo.width,
                              logo.height);
            GUI.DrawTexture(l, logo);
        }
       
        GUILayout.BeginArea(r);
            GUILayout.BeginVertical("box");   
            
                if (GUILayout.Button("Play"))
                    Application.LoadLevel("scene_main");
                    
                if (GUILayout.Button("Quit"))
                    Application.Quit();
                                    
            GUILayout.EndVertical();        
        GUILayout.EndArea();       
    }
}

You can’t use “1” as a variable name.

–Eric

How should I write it? I tried Rect one and then it gave me an error for the 1 in GUI.DrawTexture, so I changed it to Rect one and it still doesn’t work. Any ideas? I’m still fairly new to coding. :slight_smile:

Try changing your 1 to rA or something with no numbers in the name.

Thank you very much! Thanks for replying so quickly! Have a nice day, and happy coding!

This is why descriptive variable names are your friend. The code on that site uses an L not a 1 :slight_smile: