To change the name of a Unity file, the process depends on whether you are referring to a Unity Project managed through the Unity Services Dashboard or individual asset files within your local Unity project. This guide covers both scenarios to provide a complete understanding.
If you wish to change the name of your Unity Project as it appears and is managed within the Unity ecosystem's online services, you'll need to use the Unity Services Dashboard. This process specifically affects the project's identity for services like Cloud Build, Analytics, and other dashboard-integrated features, not its local folder name on your computer.
Steps to Rename Your Unity Project via Dashboard:
- Sign in to the Unity Services Dashboard. Access the official Unity Services website and log in with your Unity ID.
- Select the Project to Rename. From your list of projects, click on the specific project whose name you wish to change.
- Access Project Settings. In the left navigation pane of the project dashboard, locate and click on Settings, then select General.
- Enter New Project Name. Within the "Rename this project" textbox, type in the new name you desire for your Unity Project.
- Confirm Renaming. Click the Rename button to apply the changes.
This action updates the project's name across Unity's online services, ensuring that it is correctly identified within the dashboard and any integrated services.
Renaming Individual Files and Assets within a Local Unity Project
When "Unity file" refers to specific assets or scripts stored locally within your Unity project folder, the renaming process is typically handled directly within the Unity Editor or, with caution, via your operating system's file explorer.
Methods for Local Renaming:
Unity provides built-in mechanisms to safely rename most files and assets within your project, which helps prevent broken references.
1. Renaming Assets in the Unity Editor
This is the recommended method for renaming assets like scripts, prefabs, materials, textures, and scenes. The Unity Editor is designed to automatically update internal references when you rename an asset.
-
Steps:
- Open your Unity Project in the Unity Editor.
- Navigate to the Project window where your assets are listed.
- Select the asset you wish to rename.
- You can then:
- Press
F2
(Windows) orEnter
(macOS). - Right-click on the asset and choose Rename.
- Press
- Type the new name for the asset and press
Enter
.
-
Important Considerations for Scripts:
When renaming a C# script (.cs
) file, it's crucial that the class name defined inside the script file matches its filename exactly. If they do not match, Unity will display an error, and the script component will not function correctly. After renaming the file in the Editor, open the script and manually update the class name if necessary.
2. Renaming the Unity Project Folder (Local)
If you need to change the name of the main folder on your computer that contains your entire Unity project, follow these steps:
-
Steps:
- Close the Unity Editor. Ensure the Unity Editor is completely shut down for the project you intend to rename.
- Locate your project folder using your operating system's file explorer (e.g., Windows Explorer, macOS Finder).
- Right-click on the project folder and select Rename.
- Enter the new name for the folder.
-
Important Notes:
- This action changes only the local folder name; it does not update the project name in the Unity Services Dashboard.
- When you open Unity Hub, the project might initially appear as "Missing" or with its old path. You may need to remove the old entry from Unity Hub and then use the "Add" button to re-add the project from its new location.
Comparison of Renaming Methods
Aspect | Renaming a Unity Project (Dashboard) | Renaming Local Files/Assets (Editor) | Renaming Local Project Folder (OS) |
---|---|---|---|
Tool Used | Unity Services Dashboard | Unity Editor's Project window | Operating System's File Explorer |
What it Affects | Project name in Unity's online services | Individual asset names and references | Local path/name of the project directory |
References | Does not affect internal project references | Automatically updates most references | Requires manual re-linking in Unity Hub |
Script Naming | N/A | Class name must match filename for C# | N/A |
When to Use | For online identity and service integration | For organizing assets within the project | For local organizational purposes |