With or without a .unity file

Someone can please explain to me…: at minute 8.08 Ben explains that the way to open the game is by clicking game.unity My question is - also before creating this .unity file we could open the TerminalHacker. So what is the difference with or withou saving this file? Tnx. Dani

Hi Dani,

The file is just a scene, each scene you create will have the .unity extension, your game could comprise of scenes like this for example;

  • MainMenu.unity
  • Options.unity
  • Game.unity
  • Win.unity
  • Lose.unity

I’ve not checked the lecture/timeframe you are referring to, but is this where Ben shows the file in Windows Explorer, then double-clicks it to open it? If so, I think all Ben is demonstrating is that the .unity file types are registered against the Unity application, so you can double-click them which will in turn both launch Unity and open the specific scene.

If it was something else then let me know :slight_smile:

Thank you very much Rob - it made it clear to me!
`-)

1 Like

Incidentally, there have been some changes in the newer versions of Unity, for one, each new project comes with a default SampleScene.unity.

Additionally, Unity Hub has been released which acts as quite a nice launcher for your projects, I highly recommend installing it if you don’t already have it. The reason I mention this is because if you were to try to open your project(s) by double-clicking the scene files, your operation system will try to launch the most recent installation of Unity. This could be a problem if you have multiple versions of Unity installed and require specific projects to open in specific versions. Unity Hub is the solution to this.

Hope this helps :slight_smile:


See also;

Thanks for all the help… still I didn’t understand… In the video, Ben DID save the project, but when exiting Unity it still asked whether to save or not. Then he saved, and the default extension of the file became .unity
This doesn’ happen on my PC…It just saves the project, without creating this .unity file
I don’t know what the meaning of this is, but it is clearly different…
Do you understand the question? Could you help? Thanks a lot!

And also, of course, there is no .unity file in the “project” part of the Unity software…

I’m not entirely certain I understand your question/problem.

At what time frame are you seeing this prompt to save the project, it isn’t at 08:08.


Updated Wed Jan 16 2019 14:03

Ok, so at 07:08 Ben finishes explained the WM2000 GameObject being added to the scene and then moves on to save the project.

At this point, if you look in the Hierarchy on the left you’ll note that the scene is called “Untitled”, it also has an asterisk next to it, to indicate it hasn’t been saved.

Ben moves to save the project but forgot to save the scene. When he then tries to close Unity it prompts him to save the scene that he hadn’t previously saved (07:18), if he didn’t do this all of the changes would be lost. He then types in Game as the name of the scene, as previously it was untitled. At 07:52 as Ben moves through the explorer window you can see the Game.unity file, the scene, which was saved.

Depending on the version of Unity you are using you may have had the SampleScene at the beginning of this process, if you made changes to that and then saved the scene and then the project you wouldn’t see these prompts.

If you don’t have a scene under the Assets folder within Explorer then you’ve not saved the scene.

Does this help?

Dear Rob. It helps me enormousely what you are explainig. I just want to summerize is in my own words, and please tell whether I’m right… A prject is built out of scenes. Each scene has (or: is?) a file with a .unity extension. Indeed, when I open a new project, under Assets there is allways a subfolder named Scenes, and there is defaultly a file in it, named SampleScene.unity.

If I save my project, it is in face that SampleScene.unity file that gets updated. But if I want to give my project a different name, I go to “save as”, and choose a name, and that will be my file, sith the .unity extension. Is that right? Still one question, maybe not too important: the default .unity file is under directory “Scenes” and the file I save is under Assets. Why is this difference?

Thanks you really for your patience… `-)

Dani

Hi Dani,

First paragraph is spot on.

In the second, renaming a scene doesn’t rename your project. Those are separate things. In the video Ben demonstrated correcting the typo in his project name by amending the folder name via Windows explorer. It isnt ideal or thorough though, as if you have started creating scripts Unity will have created a solution and project file with the same name, so changing just the folder name that everything is in does not change all of these. My point here though is that scenes are scenes and do not relate to the name of your project.

If you already have a saved scene and then use File / Save As… Unity will save the same scene, in the lactation you choose, with the name that you type. This doesn’t rename the original scene and as such that would be left behind as well. Again, in the video Ben was using the Save As prompt but only because it was a previously un-saved scene. As such, nothing would be left behind.

Your version of Unity is newer than the version used to create the course which is why you have the Scenes folder and are given the SamepleScene, these are changes Unity have made to provide some housekeeping, e.g. putting your scenes in a folder called scenes but also giving you a default scene which is already saved rather than the unsaved unnamed scene.

Hope this helps :slight_smile:

Tnx a lot! i see you answering many questions, quick and accurate. I suppose we’ll meet in a further question `-)
Thanks again
Dani

1 Like

You’re very welcome Dani :slight_smile:

Privacy & Terms