Unity Tutorial - 3D Spinning Cube in 10 minutes

Create a Unity project

To begin, let's create a 3D Unity project:

  1. On Unity Hub, select Projects from the left menu.

  2. Select the New project button on the top-right corner.

    Unity Hub New project button

    The New project dialog appears.

  3. Select All templates from the left menu followed by the 3D template and name the project 3DCube. If you'd like to change where the project will be saved, change the Location settings. Then, select the Create project button.

    Unity Hub prompt to choose a project type and name

    A new project is created, and Unity opens when the project finishes loading.

  1. On Unity Hub, select Projects from the left menu.

  2. Select the New project button on the top-right corner.

    Unity Hub New project button

    The New project dialog appears.

  3. Select Core from the left menu followed by the 3D (Built-In Render Pipeline) template and name the project 3DCube. If you'd like to change where the project will be saved, change the Location settings. Then, select the Create project button.

    Unity Hub prompt to choose a project type and name

    A new project is created, and Unity opens when the project finishes loading.

Set the default code editor in Unity

Once Unity loads your project, you need to configure Unity to use the correct installation of Visual Studio.

  1. On the menu bar, select Edit > Preferences.

    Unity's preferences under the Edit menu

    The Preferences dialog appears.

  2. Select the External Tools tab. From the External Script Editor drop-down list, choose Visual Studio 2022.

    Unity's preferences dialog window with Visual Studio 2022 chosen as the external editor

    If you're not seeing Visual Studio 2022 on the list, select Browse on the drop-down list and locate your Visual Studio 2022 installation. The Visual Studio Community edition is typically found under %ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\IDE.

Once Unity loads your project, let's set Unity to use Visual Studio Code by default.

  1. On the menu bar, select Unity > Settings.

    Unity's preferences under the Unity menu

    The Preferences dialog appears.

  2. Select the External Tools tab. From the External Script Editor drop-down list, choose Visual Studio Code.

    Unity's preferences dialog window with Visual Studio Code chosen as the external editor

    If you're not seeing Visual Studio Code on the list, select Browse on the drop-down list and locate your Visual Studio Code installation. Visual Studio Code edition is typically found under Applications/Visual Studio Code.
Continue