Scene.name
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Returns the name of the Scene that is currently active in the game or app.
How to Rename a Unity Project?
I want to change the name of a Unity project to something else such that Unity Editor shows the new name at the top or when I open a script using Visual Studio, it shows the new name at the top of VS. How to do that?
Does changing the project name change the game’s name (the name that appears on top left corner of the game window)?
Does changing project name change the name of the game’s executable file?
4 Answers 4
To change Unity project name:
- Change the unity project folder name (the parent folder of ‘Assets’ folder)
- Remove any file with .sln or .csproj suffixes under the project folder. (Unity will regenerate them)
Does changing the project name change the game’s name (the name that appears on top left corner of the game window)?
No! To change the game’s name go to Edit > Project Settings > Player > Product Name and change it to the new name.
Does changing project name change the name of the game’s executable file?
No! when it comes to create a build for your game (by File > Build Settings), Unity asks you about the file name. That name becomes the name of your executable file (on PC).
How do I open the project after doing all this?
In the top right of the Unity launcher, click ‘Open’. Find and select the project folder (i.e. parent folder of the ‘Assets’ folder) and click ‘Select Folder’. The project opens in the Unity Editor.
Does this technique work in Unity v5.6.3?
Does this technique work in Unity v2017.2.0b6 ?
Partially! Step1 (Renaming the project folder name & deleting the .csproj & .sln files) still works, However Step2 (Edit > Project Settings > Player > Product Name) does not retain changes to Product Name or Company name for some reason (most likely a bug)
Step 2 (Change Game Name) Workaround:
-Close Unity.
-Directly edit those field values inside the ProjectSettings\ProjectSettings.asset file with your favourite text editor.
-Open Unity, confirm field has changed in Edit > Project Settings > Player > Product Name
Как переименовать сцену в unity
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Returns the name of the Scene that is currently active in the game or app.
How to Rename a Unity Project?
I want to change the name of a Unity project to something else such that Unity Editor shows the new name at the top or when I open a script using Visual Studio, it shows the new name at the top of VS. How to do that?
Does changing the project name change the game’s name (the name that appears on top left corner of the game window)?
Does changing project name change the name of the game’s executable file?
![]()
3 Answers 3
To change Unity project name:
- Change the unity project folder name (the parent folder of ‘Assets’ folder)
- Remove any file with .sln or .csproj suffixes under the project folder. (Unity will regenerate them)
Does changing the project name change the game’s name (the name that appears on top left corner of the game window)?
No! To change the game’s name go to Edit > Project Settings > Player > Product Name and change it to the new name.
Does changing project name change the name of the game’s executable file?
No! when it comes to create a build for your game (by File > Build Settings), Unity asks you about the file name. That name becomes the name of your executable file (on PC).
How do I open the project after doing all this?
In the top right of the Unity launcher, click ‘Open’. Find and select the project folder (i.e. parent folder of the ‘Assets’ folder) and click ‘Select Folder’. The project opens in the Unity Editor.
Does this technique work in Unity v5.6.3?
Does this technique work in Unity v2017.2.0b6 ?
Partially! Step1 (Renaming the project folder name & deleting the .csproj & .sln files) still works, However Step2 (Edit > Project Settings > Player > Product Name) does not retain changes to Product Name or Company name for some reason (most likely a bug)
Step 2 (Change Game Name) Workaround:
-Close Unity.
-Directly edit those field values inside the ProjectSettings\ProjectSettings.asset file with your favourite text editor.
-Open Unity, confirm field has changed in Edit > Project Settings > Player > Product Name
Как переименовать сцену в unity
Приветствую! В данной статье мы разберём несколько способов перехода между сценами, а именно:
- Смена сцен по названию.
- Смена сцен по индексам.
- Смена сцен, используя параметры.
Смена сцен по названию
Данный способ самый простой, и встречается он очень часто. Он используется тогда, когда нам необходимо перейти точно на определённую сцену. Для этого создадим C# скрипт, с названием, например, Scenes. И пропишем в нём следующий код:
Разбор кода
Обратите внимание, что при работе со сценами, нам необходимо обязательно подключить библиотеку:
Дальше мы создаём функцию OpenMenu(), которая будет загружать сцену с названием Menu. Вторая функция с названием OpenGame() загружаем сцену с названием Game. Убедитесь, что сцены с такими названиями существуют в Вашем проекте.
Как видите, всё очень просто. Условия, при которых Вы будете запускать данные функции, могут быть совсем разные. Например: клик на клавишу «Esc», здоровье персонажа меньше нуля, и тд. Пример:
Смена сцен по индексам
Данный способ аналогичен предыдущему, за исключением того, что мы вместо названий сцен, используем их индексы. Данный способ полезен в тех случаях, когда нам необходимо перейти на следующую или предыдущую сцену. Создадим C# скрипт, с названием, например, Scenes. И пропишем в нём следующий код:
Как видите, код аналогичен предыдущему, поэтому разбирать мы его не будем. Единственное что хотелось бы отметить, что благодаря функциям, у нас открываются чуть больше возможностей перехода на сцены. Например, мы можем перейти на следующую или предыдущую функцию:
Разбор кода
Строчки в функции NextLevel():
В первой строчке мы в переменную index мы заносим тот индекс сцены, в котором мы находимся в данный момент. А уже во второй строчке, мы увеличиваем индекс нашей сцены на единицу, и запускаем таким образом следующую сцену.
В функции PreviousLevel() всё аналогично, только индекс мы не увеличиваем на единицу, а уменьшаем. Тем самым запускаем предыдущую сцену.
Обратите внимание! Перед тем как работать со сценами по их индексам, нам необходимо добавить все сцены в Build Settings. Для этого жмём на вкладку File — Build Settings. Далее перетаскиваем все свои сцены в область Scenes in Build, и расставляем их по порядку. После чего просто закрываем данное окно. Теперь можно спокойно работать с индексами.

Смена сцен, используя параметры
Данный способ аналогичен предыдущему, только здесь мы переходим на определённую сцену исходя из переданного аргумента в нашу функцию.
Разбор кода
Функция GoToLevel() принимает в качестве аргумента номер индекса, который нам необходимо открыть, и заносит его в переменную number. Этот метод защитит нас от дублирования однотипных функций, которые по идее выполняют одно и тоже.
Давайте теперь попробуем выполнить функцию GoToLevel(), передав ей аргумент «1» следующим образом:
Конечно же, в качестве аргумента мы можем передать не только индекс, но и название. Поэтому используя открытие сцены через аргумент функции, Вы можете работать как с индексами, так и с названиями сцен.
Как переименовать сцену
Как перезапустить сцену?
Не могу перезапустить сцену, точнее сцена перезагружается, но враги перестают спавнится и.
Как затемнить сцену?
Приветствую! Такая беда: В моей 2D игре игроки, подключённые по сети, бегают по ЗАТЕМНЁННОЙ сцене.
Как узнать текущую сцену (уровень)?
Как узнать текущую сцену и вывести её в переменную? Должно получиться что то типа этого: scen =.
Как сохранить сцену после нажатия?
У меня есть игрок который может перемещаться по сценам. Например когда он первый раз зашел на сцену.
Scene.name
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Returns the name of the Scene that is currently active in the game or app.
How to Rename Your Unity Project
Chances are there will be times when you want a new name due to the nature of your game changing or even a typo in your original name.
There’s a little more to this procedure than meets the eye, so let’s dive in and take a look.
Project vs. Product name
When it comes to naming your game, there are two different names that are both relevant to your project. Let’s take a look at the differences between them.
The product name is the name of your game or simulation as defined in Project Settings . It may or may not be the same name as the file structure for your project. Changing the product name does not change the project name . One of the obvious places where the product name appears is in the bottom right-hand corner of an embedded WebGL build, as illustrated in the image below.
In this WebGL build, the product name is visible in the bottom right corner.
The project name is the top-level folder of your project, where all of your assets and game data are stored. This is the name you will see in Unity Hub when you go to open up your project. If you change the project name , you will need to re-add your project back into the Hub in order to edit it again.
An example of a local repository for Unity projects. Each folder represents a different project name.
Changing the name
Now let’s look at how to rename both a Unity product and a Unity project.
Renaming the product
Open up the product you want to rename. Go to File -> Build Settings -> Player Settings .
Select the Player category from the list on the left. You will now see a place to enter in the product name on the right.
Make your edits and close the Player Settings window. Your product now has a new name.
The Project Settings window in Unity.
Renaming the project
Open up the Unity Hub and click the three dots next to the project name .
Select Show in Explorer .
Rename your Unity project by right-clicking and selecting Rename .
Close down the Unity Hub and open it back up again. Your renamed project must be added back into the Hub. With Projects selected on the left, click Add .
Navigate to your Unity project and click Select Folder . Your renamed project should now reappear in the Hub.
The Unity Hub is where you can view different project names.
Thanks for reading! If you enjoyed this article, please like, share, or follow. You can also reach me on Twitter or Instagram.
Did you find this article valuable?
Support Taryn McMillan by becoming a sponsor. Any amount is appreciated!