Build UE4 from Source

The following section describes how to download, compile, and launch UE4 from the Oculus GitHub repository using Visual Studio.

Professional developers who wish to take full advantage of the features available with the Oculus Unreal integration should download and build the Unreal Engine source code.


  • You have installed Visual Studio 2017 or 2019 and are familiar with its use. Note that Unreal Engine 4 uses VS 2017 by default, but also supports VS 2019.

To Download and Build Unreal Engine

The following steps will walk you through acquiring Unreal Engine source code, and compiling the code.

Several of these steps may take some time to complete; some of the steps may take over an hour depending on your computer and the speed of your Internet connection.

  1. Clone or download the UE4 source code from the Oculus GitHub repository here: To access this repository, you must have access to the private Epic GitHub repository (see for details).
  2. If you downloaded a zip archive of the code, extract the archive contents to a directory where you would like to build the engine, e.g., C:\Unreal\4.xx-oculus.


You should unzip or clone the source code to a folder with a short path, or the next steps may fail. Alternately, you can map your install directory as a Windows drive to reduce the path length.

  1. Run Setup.bat. Click Yes to accept changes to your device if prompted.
  2. Run GenerateProjectFiles.bat. By default, GenerateProjectFiles.bat creates project files for Visual Studio 2017. If you have Visual Studio 2019 installed, use the -2019 flag (GenerateProjectFiles.bat -2019) to generate project files compatible with Visual Studio 2019.
  3. Launch UE4.sln to open the project solution in Visual Studio. You may be prompted to install additional features for Unreal Engine development. Accept those changes.
  4. In Visual Studio, launch Configuration Manager by selecting Build > Configuration Manager. In Configuration Manager, set Active solution configuration to Development Editor, and Active solution platform to Win64. The following image shows an example.

  5. In the Solution Explorer, right-click UE4 under Engine and select Set as Startup Project. The following image shows an example.

  6. Select Build from the same context menu as the previous step.
  7. To launch the engine:
    • With command-line arguments: Right-click UE4 in the Solution Explorer and select Properties. In the UE Property Pages dialog, select Configuration Properties > Debugging on the left. Enter any desired configuration options in the Command Arguments field on the top.
    • Without command-line arguments: In the Solution Explorer on the right, right-click UE4 under Engine and, in the context menu, select Debug > Start new instance to launch the engine. The following image shows an example.
  8. Select the project you would like to open, or specify a new project. If you are creating a new project, don’t forget to specify a project name.
  9. At this point, the engine will close and a new instance of Visual Studio will launch with your selected or new project. Repeat step 6 to launch the engine with the specified project.

For more information, see Epic’s instructions on building the Unreal Engine from source: Building Unreal Engine from Source.